Bug 395550

Summary: Extending "hints" with user provided regular expressions
Product: [Applications] konsole Reporter: Emil Sedgh <emilsedgh>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: wishlist CC: tcanabrava
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Emil Sedgh 2018-06-18 08:19:00 UTC
Konsole already has this amazing "URL Hints" feature. You wouldn't have to use your mouse to open the URL's.

The idea is extending the same feature to it supports "hints" for any regular expressions.

For example, I personally have to deal with a lot of uuid's during the day.

They generally look like this:

7b6436b2-005d-11e7-b9c2-f23c91b0d077

The idea is that I'd give this regular expression to Konsole:

/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89AB][0-9a-f]{3}-[0-9a-f]{12}$/i

Then, every time I hold the "hint" keyboard shortcut, it would detect those strings as well, and offer them to me to open them.

And instead of opening them in the browser, it would just copy them to the clipboard.

Konsole can then provide a list of widely known regular expressions by default.

For example:

UUID
Hex Colors
ISO Date's
...

That'd make Konsole much much more keyboard friendly.
Comment 1 Emil Sedgh 2018-06-18 09:06:46 UTC
I actually looked into Konsole's source code.

It seems that the basis for executing this feature is almost already there through filter chain.

There is already an extendable Filter Chain which can take in classes for processing.

I think the majority of the work is just adding the UI to manage the list of regular expressions.
Comment 2 tcanabrava 2018-06-18 10:05:45 UTC
I like the idea, considering that you already looked in the sources any change you could also provide a small implementation?
Comment 3 Emil Sedgh 2018-06-18 14:58:18 UTC
I have not done any cpp programming in many years, so I'd be struggling about it.

However, I can try. But I'm not sure if I'll be successful at it.
Comment 4 tcanabrava 2018-06-18 16:56:41 UTC
You can always ask questions, we really need more developers. :)
Comment 5 Emil Sedgh 2018-06-18 17:06:42 UTC
I will give it a try, but I probably am gonna fail ;)