Skip to content

Open Julia in iTerm rather than Terminal if iTerm's installed #24906

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

Closed
wants to merge 1 commit into from
Closed

Open Julia in iTerm rather than Terminal if iTerm's installed #24906

wants to merge 1 commit into from

Conversation

cormullion
Copy link
Contributor

When run, this script looks to see if iTerm is installed. If it is, it opens iTerm, creates a new window, and runs Julia. If it isn't, create a new window in Terminal and run Julia.

This doesn't help someone who has previously installed iTerm but still prefers Terminal...

More testing on all possible permutations of Mac hardware, OS versions, and terminal apps would be nice; I've tried a few but have run out of Macs.

When run, this script looks to see if iTerm is installed. If it is, it opens iTerm, creates a new window, and runs Julia. If it isn't, create a new window in Terminal and run Julia. 

This doesn't help someone who has previously installed iTerm but still prefers Terminal...
@oxinabox
Copy link
Contributor

oxinabox commented Dec 4, 2017

Huh,
apparently mac does't have the notion of a default terminal.

https://superuser.com/questions/379342/setting-iterm2-as-the-default-terminal-osx-lion
https://superuser.com/questions/491632/does-x-terminal-emulator-work-on-os-x

The equivalent is to set a terminal as the default handler for some protocols, e.g. ssh.
Though idk how often that is done, given one does not normally attempt to follow a ssh://foo.com link.
I guess one could thus check if iterm is the default handler for ssh, and if so assume the user likes iterm and thus open julia in iterm. And if not use terminal.
but idk that users would actually bother to keep the default handler correct, as I mentioned.

@cormullion
Copy link
Contributor Author

cormullion commented Dec 4, 2017

Yes, it’s all a bit under-featured without doing some more installation work. This is just handling the “double-click the app icon to start” case, so you could argue that ssh-ers would be launching Julia from their preferred terminal app anyway...

@StefanKarpinski
Copy link
Member

LGTM modulo the fact that AppleScript is a read-only language, so kudos for getting anything to work at all. This definitely seems like a better experience for iTerm2 users.

@yurivish
Copy link
Contributor

yurivish commented Dec 4, 2017

Yes, thanks for doing this!

@vtjnash
Copy link
Member

vtjnash commented Jun 19, 2019

cf. #4197 (comment)
reverts #18522 (reopens #14427)
reverts #14365 partially

@vtjnash vtjnash closed this Jun 19, 2019
@vtjnash
Copy link
Member

vtjnash commented Jun 19, 2019

this script returns:

error "System Events got an error: Script Editor is not allowed to send keystrokes." number 1002

@cormullion
Copy link
Contributor Author

:) since this PR Apple have probably released two major (breaking) versions of the operating system.

@vtjnash
Copy link
Member

vtjnash commented Jun 19, 2019

yes, although if you follow the first link, I first tried this in 2013, and it couldn't be used then either for the same reason

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

Successfully merging this pull request may close these issues.

5 participants