Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for using alternative terminal apps for SSM session (iTerm as terminal on MacOS) #62

Closed
h-svab opened this issue Jan 14, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@h-svab
Copy link

h-svab commented Jan 14, 2021

Is your feature request related to a problem? Please describe.
I usually use iTerm as terminal which is superior to the Terminal app included in MacOS. It would be nice to be able to configure the terminal app that is being used for SSM session.

Describe the solution you'd like
Provide a configuration option which terminal should be used for starting a SSM session.

Describe alternatives you've considered
I don't use this feature at the moment but start the ssm session in the terminal of my choice.

@h-svab h-svab added the enhancement New feature or request label Jan 14, 2021
@pethron
Copy link
Contributor

pethron commented Jan 14, 2021

We could provide a field for the user to select the path to the terminal executable

@h-svab
Copy link
Author

h-svab commented Jan 15, 2021

That sounds good, I was looking at the code that executes the command and on MaxOS Leapp uses Applescript commands with osascript
I'm still experimenting what the proper osascipt command would look like for iTerm2

@h-svab
Copy link
Author

h-svab commented Jan 15, 2021

Ok once again Google won: https://apple.stackexchange.com/a/360827

osascript \
    -e 'tell application "iTerm2" to tell current window to set newWindow to (create tab with default profile)'\
    -e 'tell application "iTerm2" to tell current session of newWindow to write text "aws --region eu-west-1 ssm start-session --target i-0***************4"'

@pethron
Copy link
Contributor

pethron commented Jan 18, 2021

Thanks @h-svab for the suggestion. We still need a way to let the user select the preferred executable and verify that it's installed. I think we could use a dialog to let the user select the path to the executable. I'd like to know what @urz9999 and @ericvilla think about this.

@jgrumboe
Copy link
Contributor

jgrumboe commented Jun 7, 2021

Are there any updates on this?
I'm also using iTerm2 on MacOS. Since this change is coupled to a specific osascript you could probably just make it a MacOS select box to choose between standard terminal or iTerm2.

@andreacavagna01
Copy link
Contributor

This feature was not in the roadmap, but we are adding it to match the System Preferences.
In order to make the thing work cross-platform we need to implement an AppleScript specific for ITerm in Mac like this:

tell application "iTerm"
	set newWindow to (create window with default profile)
	tell current session of newWindow
		write text "ssm command to run"
	end tell
end tell

But I still need to look for other Operating Systems (Linux and Windows).

Definitely is a feature I want to add soon after this coming release.

Any other ideas on how to implement this solution?

public openTerminal(command: string): Observable<any> {

As seen here, in the executeService, we are already using osascript to open external terminal windows.

I'm an iTerm user too 👍

@MaartenUreel
Copy link

I would also like to see this feature; I prefer the new "Windows Terminal" from Microsoft (https://github.com/microsoft/terminal) but Leapp opens cmd.exe by default.

Having this configurable would be convenient! :)

@ericvilla
Copy link
Contributor

In Leapp v0.10.0 you can start an AWS SSM session through iTerm2 by selecting it in the options menu!

Referenced by #176

@ericvilla
Copy link
Contributor

Thanks to @jgrumboe for the Pull Request #184!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants