Search code examples
macosjulia

How to make julia.app launch in iTerm instead of macOS' Terminal.app?


I installed the Julia language for macOS as downloaded from the official website Manual Download (not the juliaup option which did not exist when I wrote this question).

When I launch Julia (meaning, when I click the Julia icon or when I look for julia in spotlight), the REPL is launched in macOS's Terminal.app, but I wish to have it launched from iTerm. How can I tell julia to launch iTerm instead of Terminal.app?

Edit: This question is NOT about how to launch julia program from within iTerm2. It is about making the julia.app icon launch julia in iTerm2


Solution

  • The julia app uses apple script to tell the terminal to launch its process. You can modify the script and tell iTerm to be opened instead. For this:

    1. Go to Go to Applications> press option-click (or right click if you have it) on the julia app you wish to modify and then click show package contents > contents > Resources > Scripts, and modify main.scpt.

    My script reads

    tell application "iTerm"
        tell current window
            create tab with default profile command "/Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia"
            activate
        end tell
    end tell
    

    This makes the julia app to launch iTerm with the default profile instead of Terminal.app. It is possible that you need yo modify this path if the app is not called Julia-1.5, as in my case.