I have made a few hacks on my Linux/Gnome system with the purpose to make the terminal more friendly with the desktop environment.
What I wanted was something very simple from the user’s point of view:
Imagine you execute a ‘ls’ command and it outputs a list of files.
Why wouldn’t you be able to open one of these files be simply clicking in it’s name from the terminal?
How does it work?
Vte is the terminal emulator widget used in Gnome. It was modified to process a new kind of escape sequence that allows an application running inside the terminal to give meta-information about one piece of the text it writes on the terminal.
The rest of the work was made in Terminator, which I choose because I like it and it is written in Python!
The ls command was modified to produce this meta-information when it detects the terminal supports this funcionality. This happens the same way for instance, it generates a color output when it detects the terminal support colors. This change in ls was made as a demonstration. Other commands like find or du could be adapted also to produce the information.
All was done in such a way to interfere as little as possible in the usual way of working with the terminal. To avoid unexpected behaviours all operations are initiated from context menus, including drag and drop actions:
Please post comments in this page or contact me at idnael @ gmail.com!