Hyperlinks on path elements in graphical session
Created by: nojhan
I guess most of users spend their time in the terminal under a graphical session, thus having access to the mouse and graphical apps. It happens to me quite often to start a graphical file browser from within the terminal, to do something that is more easily done in it (like image browsing, complex files selection, etc.). As of now, you have to write down the command starting the browser to actually start it from the current directory. It would be easier if it was just one click away from where the user is: the terminal.
Fortunately, there is a set of OSC escape sequences which can add an hyperlink into a text and which is now quite supported by terminal emulators (see [1][2]).
For example, this hides the file:///home/nojhan/code/
URL within the code
text, which is then displayed with a dotted underline:
printf '\e]8;;file:///home/nojhan/code/\e\\code\e]8;;\e\\\n'
The path formatting function (_lp_path_format
) should have an option to insert file://
URLs behind each path element.