You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For command such as "open in a [web|file] browser", the hyperlink_rules feature already does the job. But if one want to trigger just any command, it cannot work, as it is limited to a predefined set of protocols.
At least URxvt and Terminator have this feature. I implemented it in Terminator, by using the existing link handler, and allow adding a terminator:// protocol, that bypass xdg-open and run the configured command. This had the minimum footprint and reused the existing link handling code.
Example
Run a script that display the info to catch, here a Python script displaying THE ABSOLUTE PATH.
echo"print('What the F)"> test.py
python3 $(pwd)/test.py
Note that if you just do ./test.py, then the path information is contextual and it's not going to work (or else we would need to pass the current directory from the shell to the URL manager). In that case, the observed behaviour would be to open an empty file.
Then, you have to pass the mouse over the path segment to see it underlined, and [Ctrl-] click to open it.
Example (the mouse is over the link):
The text was updated successfully, but these errors were encountered:
Thanks. That's actually 118 lines of code with several config entry points for the user to maintain. Is there any chance that such a useful feature would be included in the codebase at some point?
I want to be able to open a file at a specific line in my IDE, just by clicking on an error message in my terminal.
For instance, for opening a python script indicated in a python error, within Vim, I would use configure the following option:
For command such as "open in a [web|file] browser", the hyperlink_rules feature already does the job. But if one want to trigger just any command, it cannot work, as it is limited to a predefined set of protocols.
At least URxvt and Terminator have this feature. I implemented it in Terminator, by using the existing link handler, and allow adding a
terminator://
protocol, that bypass xdg-open and run the configured command. This had the minimum footprint and reused the existing link handling code.Example
Run a script that display the info to catch, here a Python script displaying THE ABSOLUTE PATH.
Note that if you just do ./test.py, then the path information is contextual and it's not going to work (or else we would need to pass the current directory from the shell to the URL manager). In that case, the observed behaviour would be to open an empty file.
Then, you have to pass the mouse over the path segment to see it underlined, and [Ctrl-] click to open it.
Example (the mouse is over the link):
The text was updated successfully, but these errors were encountered: