gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.36k stars 293 forks source link

[Feature request] Show hyperlink tooltip (when mouse hovers over a hyperlink) #2156

Open voiduin opened 1 year ago

voiduin commented 1 year ago

Hello tilix developers! I want to thank you for the work done - I have been using your terminal for about a year at home and at work. I like everything - but I found one function that I want to use - but unfortunately it is not available at the moment.

I searched for tickets, plus search in the code and did not find a mention this feature in this repository.

1. Feature desc

Please implement the function terminal show a tooltip when your mouse hovers over a link.

This function is needed not only for direct use - displaying the target of a hyperlink. I use tooltip to show extended info in terminal for objects (files, packages etc) This use case is shown in the screenshot of the xiate terminal below.

2. Examples of what it looks like:

This functionality is implemented in at least two terminals

2.1 gnome-terminal

An example of what it looks like on my gnome terminal

2.2) xiate terminal

An example of how it looks in the project blog

Source: https://www.uninformativ.de/blog/postings/2018-04-14/0/POSTING-en.html

3. Usage examples in tilix

I wanted to make a patch - but I haven't been able to figure out the tilix sources yet.

As far as I understand from the sources, you are already using the toolkit to display some information in the GUI. For example here: https://github.com/gnunn1/tilix/blob/5008e73a278a97871ca3628ee782fbad445917e7/source/gx/tilix/prefeditor/bookmarkeditor.d#L62

This is an example of how the tooltip looks like when hovering over a button "+" in the tilix interface:

4. Hyperlink tooltip implementation example on GTK

Both projects use the gtk_widget_set_tooltip_text() function to display the tooltip text

4.1. XIATE

Here is a commit in another project - where this feature is implemented. https://www.uninformativ.de/git/xiate/commit/e4739e66255938b0ac324261713863ef15a7b6c7.html#h0-0

4.2. Gnome terminal

This commit https://github.com/GNOME/gnome-terminal/commit/1c6f8db736efc62d9a9b38bfbc43ec03c8544696 This line in file https://github.com/GNOME/gnome-terminal/blob/1c6f8db736efc62d9a9b38bfbc43ec03c8544696/src/terminal-window.c#L3143