diff options
author | Wynn Wolf Arbor | 2020-03-28 15:10:55 +0100 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-04-13 15:45:26 +0200 |
commit | 30bbf529ad3073fd449c7f9331a889b114fad1e1 (patch) | |
tree | de43218ab0a4e4fc12816251144b55010e8c01a4 /terminal.ui | |
parent | bed4cae59bfd5ac100caa3a4ac795f33598b6ab0 (diff) | |
download | weltschmerz-30bbf529ad3073fd449c7f9331a889b114fad1e1.tar.gz |
Add OSC 8 hyperlink support
This commit adds support for the OSC 8 hyperlink escape sequence [1]. As
this is not a mature feature and there seem to be outstanding security
concerns [2], the setting that controls whether or not OSC 8 is
interpreted is disabled by default.
Just like gnome-terminal, weltschmerz will display a tooltip with the
canonicalized URI when hovering over a hyperlink.
[1] https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[2] https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#security
Diffstat (limited to 'terminal.ui')
-rw-r--r-- | terminal.ui | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/terminal.ui b/terminal.ui index c82a04d..4ba9555 100644 --- a/terminal.ui +++ b/terminal.ui @@ -3,6 +3,28 @@ <interface> <requires lib="gtk+" version="3.20"/> <requires lib="vte-2.91" version="0.54"/> + <object class="GtkImage" id="copy_hyperlink_image"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-copy</property> + </object> + <object class="GtkMenu" id="hyperlink_context_menu"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkImageMenuItem" id="copy_hyperlink_item"> + <property name="label" translatable="yes">_Copy hyperlink</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Copy the hyperlink's URI to the clipboard</property> + <property name="use_underline">True</property> + <property name="image">copy_hyperlink_image</property> + <property name="use_stock">False</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="uri_copy" swapped="no"/> + </object> + </child> + </object> <object class="GtkImage" id="copy_url_image"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -21,7 +43,7 @@ <property name="image">copy_url_image</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <signal name="activate" handler="url_match_copy" swapped="no"/> + <signal name="activate" handler="uri_copy" swapped="no"/> </object> </child> </object> @@ -58,6 +80,7 @@ <signal name="button-press-event" handler="vte_button_press" swapped="no"/> <signal name="button-release-event" handler="vte_button_release" swapped="no"/> <signal name="child-exited" handler="gtk_main_quit" swapped="no"/> + <signal name="hyperlink-hover-uri-changed" handler="vte_hyperlink_hover" swapped="no"/> <signal name="key-press-event" handler="vte_key_press" swapped="no"/> <signal name="scroll-event" handler="vte_scroll" swapped="no"/> <signal name="window-title-changed" handler="window_set_title" swapped="no"/> |