Search code examples
elixiriterm2

item2 path not recognised as a clickable path


when I command-click a path in iTerm2, the click opens Atom with the corresponding file :)

but my application logger is showing paths like, lib/app/helpers/date_helper.ex:213 in the iterm2 console.

These paths are not recognised as an path. So a command-click doesn't work. How to tell iTerm2, that as lib/app/users/user.ex:100 is a path and line number.


Solution

  • You need to first register Atom as the default application for .ex files with OSX (by doubly clicking on a .ex file in a Finder window, for example).

    I tested this and before I registered a default application, nothing happened when command-clicking on lines such as lib/test.ex:32, but after registering it, it now opens the files in the application I specified (providing the file exists).

    For anyone reading this that wants to open the file in the same terminal session, setting up a coprocess is useful:

    Click on: Preferences -> Profiles -> Advanced

    Under "Semantic History", choose "Run coprocess..". In the text field, put:

    echo vim \1 +\2