Skip to content

Commit

Permalink
Add support for hyperlinks
Browse files Browse the repository at this point in the history
janza authored and jelly committed Oct 26, 2017
1 parent 285f4d7 commit 14ee4ff
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ font = Monospace 9
scrollback_lines = 10000
#search_wrap = true
#urgent_on_bell = true
#hyperlinks = false

# $BROWSER is used by default if set, with xdg-open as a fallback
#browser = xdg-open
3 changes: 3 additions & 0 deletions man/termite.config.5
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ Set the default browser for opening links. If its not set,
.IP \fIclickable_url\fR
Auto-detected URLs can be clicked on to open them in your browser. Only
enabled if a browser is configured or detected.
.IP \fIhyperlinks\fR
Enable support for applications to mark text as hyperlinks. Requires
clickable_url to be set.
.IP \fIcursor_blink\fR
Specify the how the terminal's cursor should behave. Accepts
\fBsystem\fR to respect the gtk global configuration, \fBon\fR and
7 changes: 7 additions & 0 deletions termite.cc
Original file line number Diff line number Diff line change
@@ -1169,7 +1169,11 @@ gboolean position_overlay_cb(GtkBin *overlay, GtkWidget *widget, GdkRectangle *a

gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event, const config_info *info) {
if (info->clickable_url && event->type == GDK_BUTTON_PRESS) {
#if VTE_CHECK_VERSION (0, 49, 1)
auto match = make_unique(vte_terminal_hyperlink_check_event(vte, (GdkEvent*)event), g_free);
#else
auto match = make_unique(check_match(vte, event), g_free);
#endif
if (!match)
return FALSE;

@@ -1459,6 +1463,9 @@ static void set_config(GtkWindow *window, VteTerminal *vte, GtkWidget *scrollbar
vte_terminal_set_mouse_autohide(vte, cfg_bool("mouse_autohide", FALSE));
vte_terminal_set_allow_bold(vte, cfg_bool("allow_bold", TRUE));
vte_terminal_search_set_wrap_around(vte, cfg_bool("search_wrap", TRUE));
#if VTE_CHECK_VERSION (0, 49, 1)
vte_terminal_set_allow_hyperlink(vte, cfg_bool("hyperlinks", FALSE));
#endif
info->dynamic_title = cfg_bool("dynamic_title", TRUE);
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
info->clickable_url = cfg_bool("clickable_url", TRUE);

0 comments on commit 14ee4ff

Please sign in to comment.