[gnome-builder] terminal: add toggle for OSC 8 escape sequences
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] terminal: add toggle for OSC 8 escape sequences
- Date: Fri, 15 Jan 2021 21:38:32 +0000 (UTC)
commit 7fded72ef3174c45ac514e9b198cf009bc7104a6
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 15 13:38:14 2021 -0800
terminal: add toggle for OSC 8 escape sequences
data/gsettings/org.gnome.builder.terminal.gschema.xml | 3 +++
src/libide/terminal/ide-terminal.c | 3 +--
src/plugins/terminal/gbp-terminal-preferences-addin.c | 12 ++++++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/data/gsettings/org.gnome.builder.terminal.gschema.xml
b/data/gsettings/org.gnome.builder.terminal.gschema.xml
index bd8980bac..fa45050b3 100644
--- a/data/gsettings/org.gnome.builder.terminal.gschema.xml
+++ b/data/gsettings/org.gnome.builder.terminal.gschema.xml
@@ -3,6 +3,9 @@
<key name="allow-bold" type="b">
<default>true</default>
</key>
+ <key name="allow-hyperlink" type="b">
+ <default>true</default>
+ </key>
<key name="font-name" type="s">
<default>"Monospace 11"</default>
</key>
diff --git a/src/libide/terminal/ide-terminal.c b/src/libide/terminal/ide-terminal.c
index 572a61a25..817707eb4 100644
--- a/src/libide/terminal/ide-terminal.c
+++ b/src/libide/terminal/ide-terminal.c
@@ -557,8 +557,6 @@ ide_terminal_init (IdeTerminal *self)
dzl_widget_action_group_attach (self, "terminal");
- vte_terminal_set_allow_hyperlink (VTE_TERMINAL (self), TRUE);
-
for (guint i = 0; i < G_N_ELEMENTS (url_regexes); i++)
{
g_autoptr(VteRegex) regex = NULL;
@@ -574,6 +572,7 @@ ide_terminal_init (IdeTerminal *self)
priv->settings = g_settings_new ("org.gnome.builder.terminal");
g_settings_bind (priv->settings, "allow-bold", self, "allow-bold", G_SETTINGS_BIND_GET);
+ g_settings_bind (priv->settings, "allow-hyperlink", self, "allow-hyperlink", G_SETTINGS_BIND_GET);
g_settings_bind (priv->settings, "scroll-on-output", self, "scroll-on-output", G_SETTINGS_BIND_GET);
g_settings_bind (priv->settings, "scroll-on-keystroke", self, "scroll-on-keystroke", G_SETTINGS_BIND_GET);
g_signal_connect_object (priv->settings,
diff --git a/src/plugins/terminal/gbp-terminal-preferences-addin.c
b/src/plugins/terminal/gbp-terminal-preferences-addin.c
index 01cf6e13f..c1bf5d439 100644
--- a/src/plugins/terminal/gbp-terminal-preferences-addin.c
+++ b/src/plugins/terminal/gbp-terminal-preferences-addin.c
@@ -35,6 +35,7 @@ struct _GbpTerminalPreferencesAddin
guint scroll_on_keystroke_id;
guint font_id;
guint allow_bold_id;
+ guint allow_hyperlink_id;
};
static void
@@ -70,6 +71,17 @@ gbp_terminal_preferences_addin_load (IdePreferencesAddin *addin,
_("If terminals are allowed to display bold text"),
C_("Keywords", "terminal allow bold"),
2);
+ self->allow_hyperlink_id = dzl_preferences_add_switch (preferences,
+ "terminal",
+ "general",
+ "org.gnome.builder.terminal",
+ "allow-hyperlink",
+ NULL,
+ NULL,
+ _("Show hyperlinks"),
+ _("When enabled hyperlinks (OSC 8 escape sequences)
are recognized and displayed"),
+ C_("Keywords", "terminal show hyperlinks links
urls"),
+ 3);
self->scroll_on_output_id = dzl_preferences_add_switch (preferences,
"terminal",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]