[Konsole-devel] Code'n Greets (File recognition in konsole)

Jekyll Wu adaptee at gmail.com
Sun May 20 00:22:12 UTC 2012


于 2012年05月20日 06:28, Rodrigo Fernandes 写道:
> Greetings fellow konsole developers.
>
> First a small introduction for those that might not know me:
>
> My name is Rodrigo Fernandes, I've been a open/source / KDE user since early
> version 2.
>
> I have extensive academic and professional background in C/C++, and Qt.
>
> While I have multiple ideas I'd like to see take shape in KDE, I decided to
> contribute to konsole first, others will follow suit.
>
> I've just dabbled in the first of them; integration of file recognition in
> konsole. Using a small 1min hack (see attached diff) I am now able to open files
> in the same fashion a email or address is linked.
> Due to the simplicity of the code (and given that I'm looking for some sort of
> "go-a-head blessing") I thought it'd share it before proceeding. It's limited
> to a simplistic regexp, and the usage of $PWD has serious limitations (assumes
> linux only), but it demonstrates the point.
>
> To implement a proper version I would have to make some basic changes to the
> hotspots.
>
> As such I would very much appreciate your collective feedback. Is this a
> feature you would like to have ?
>
> Thank you,
>   Rodrigo (cyber_fusion) Fernandes


Hi Rodrigo:

Thanks for choosing konsole as your first shot :)

Unfortunately, it is currently not a good time for adding new feature. 
KDE SC 4.9 has just been feature frozen two days ago.

The idea of recognizing file path is good and useful. But it is not easy 
to provide a trouble-free implementation.  Here are some of my thoughts 
about this feature (actually I have considered this feature in my head 
for sometime).

The first problem is: what kind of file path should be recognized ?

   * A plain filename like 'CMakeLists.txt' should better not be taken 
into consideration, because that would cause too many recognitions when 
you move the mouse after a plain 'ls' command, which is just noisy and 
not that useful.

   * A absolute path is the safest candidate, since we can always open 
it regardless of the current working directory of the session.

   * A relative path like "./src/CMakeLists.txt" or "../src/main.cpp" is 
very useful, but opening it is highly influenced by the current working 
directory of the session.  That context-related nature could be quite 
problematic, especially when taking the filepath in the scrollback into 
consideration.


The second problem is :  when should that recognition be enabled?

   * If the session is in remote connection, such recognition should 
better be disabled. Unfortunately, the current code simply does not 
support that kind of flexibility.

   * If we are using vim, such recognition should better be disabled, or 
only absolute path should be supported.


So it is definitely not easy to provide a trouble-free implementation.

By the way, roxterm provides similar feature, which could be used as a 
reference .




More information about the konsole-devel mailing list