Limit the command line to 1024 characters when used as the title

Based on code written by Bill Nottingham.

https://bugzilla.redhat.com/show_bug.cgi?id=1789142
This commit is contained in:
Debarshi Ray 2020-03-05 13:19:26 +01:00
parent afacf766d2
commit 6eeb8ca9db
3 changed files with 3164 additions and 109 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
From 47af5b56c82453c837a6206cb1371cbf8cfafd05 Mon Sep 17 00:00:00 2001 From 2923e923ba8fa606d9d1780415182b9607e67a83 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Mon, 12 May 2014 14:57:18 +0200 Date: Mon, 12 May 2014 14:57:18 +0200
Subject: [PATCH 01/17] Restore transparency Subject: [PATCH 01/16] Restore transparency
The transparency settings were removed as a side effect of The transparency settings were removed as a side effect of
2bff4b63ed3ceef6055e35563e9b0b33ad57349d 2bff4b63ed3ceef6055e35563e9b0b33ad57349d
@ -234,10 +234,10 @@ index 7a8953c50388..a3d77bf6719d 100644
2.24.1 2.24.1
From d09de0b9733d14e2cbe369b3c1cfe0a745cae8de Mon Sep 17 00:00:00 2001 From 9eba9a41d17f63d0cf64c0ad389671c0b124cbdd Mon Sep 17 00:00:00 2001
From: Lars Uebernickel <lars.uebernickel@canonical.com> From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Wed, 28 May 2014 14:11:02 +0200 Date: Wed, 28 May 2014 14:11:02 +0200
Subject: [PATCH 02/17] window: Make the drawing robust across all themes Subject: [PATCH 02/16] window: Make the drawing robust across all themes
There are lots of themes out there in the wild that do not specify a There are lots of themes out there in the wild that do not specify a
background-color for all widgets and the default is transparent. This background-color for all widgets and the default is transparent. This
@ -296,20 +296,20 @@ index a3d77bf6719d..36d155a9e420 100644
2.24.1 2.24.1
From c73d51eba01ee850ee46828b41c2eddfe83d680d Mon Sep 17 00:00:00 2001 From 989030cd66b311c1b5041323b8fb1a5320251a93 Mon Sep 17 00:00:00 2001
From: "Owen W. Taylor" <otaylor@fishsoup.net> From: "Owen W. Taylor" <otaylor@fishsoup.net>
Date: Fri, 13 Nov 2015 15:16:42 +0100 Date: Fri, 13 Nov 2015 15:16:42 +0100
Subject: [PATCH 03/17] screen, window: Extra padding around transparent Subject: [PATCH 03/16] screen, window: Extra padding around transparent
terminals in Wayland terminals in Wayland
https://bugzilla.redhat.com/show_bug.cgi?id=1207943 https://bugzilla.redhat.com/show_bug.cgi?id=1207943
--- ---
src/terminal-screen.c | 40 +++++++++++++++++++++++++++++++++++++--- src/terminal-screen.c | 41 +++++++++++++++++++++++++++++++++++++----
src/terminal-window.c | 18 ++++++++++++------ src/terminal-window.c | 18 ++++++++++++------
2 files changed, 49 insertions(+), 9 deletions(-) 2 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 29d72df8883c..ded98da711d2 100644 index 29d72df8883c..92b0053de763 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -154,6 +154,8 @@ static void terminal_screen_system_font_changed_cb (GSettings *, @@ -154,6 +154,8 @@ static void terminal_screen_system_font_changed_cb (GSettings *,
@ -362,7 +362,15 @@ index 29d72df8883c..ded98da711d2 100644
static void static void
update_color_scheme (TerminalScreen *screen) update_color_scheme (TerminalScreen *screen)
{ {
@@ -1207,9 +1236,7 @@ update_color_scheme (TerminalScreen *screen) @@ -1142,7 +1171,6 @@ update_color_scheme (TerminalScreen *screen)
GdkRGBA *cursor_bgp = NULL, *cursor_fgp = NULL;
GdkRGBA *highlight_bgp = NULL, *highlight_fgp = NULL;
GtkStyleContext *context;
- GtkWidget *toplevel;
gboolean transparent;
gboolean use_theme_colors;
@@ -1207,9 +1235,7 @@ update_color_scheme (TerminalScreen *screen)
vte_terminal_set_color_highlight (VTE_TERMINAL (screen), highlight_bgp); vte_terminal_set_color_highlight (VTE_TERMINAL (screen), highlight_bgp);
vte_terminal_set_color_highlight_foreground (VTE_TERMINAL (screen), highlight_fgp); vte_terminal_set_color_highlight_foreground (VTE_TERMINAL (screen), highlight_fgp);
@ -373,7 +381,7 @@ index 29d72df8883c..ded98da711d2 100644
} }
static void static void
@@ -1791,6 +1818,13 @@ terminal_screen_do_popup (TerminalScreen *screen, @@ -1791,6 +1817,13 @@ terminal_screen_do_popup (TerminalScreen *screen,
terminal_screen_popup_info_unref (info); terminal_screen_popup_info_unref (info);
} }
@ -423,36 +431,10 @@ index 36d155a9e420..c0219d872725 100644
2.24.1 2.24.1
From 3afcb1c12eea68ce797ba84728a487437e165dee Mon Sep 17 00:00:00 2001 From 595cbb78a8731683e34b919c54ab0b4112c0b4d2 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Mon, 27 Feb 2017 16:53:51 +0100
Subject: [PATCH 04/17] screen: Silence -Wunused variable
https://bugzilla.redhat.com/show_bug.cgi?id=1207943
---
src/terminal-screen.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index ded98da711d2..92b0053de763 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1171,7 +1171,6 @@ update_color_scheme (TerminalScreen *screen)
GdkRGBA *cursor_bgp = NULL, *cursor_fgp = NULL;
GdkRGBA *highlight_bgp = NULL, *highlight_fgp = NULL;
GtkStyleContext *context;
- GtkWidget *toplevel;
gboolean transparent;
gboolean use_theme_colors;
--
2.24.1
From d3d4b92675edb058bcf4130ae8e707dc05d55ef9 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Fri, 18 May 2018 20:15:34 +0200 Date: Fri, 18 May 2018 20:15:34 +0200
Subject: [PATCH 05/17] screen: Try harder to find a foreground process group Subject: [PATCH 04/16] screen: Try harder to find a foreground process group
member member
For pipelined commands, it's possible that the process group leader, For pipelined commands, it's possible that the process group leader,
@ -519,10 +501,10 @@ index 92b0053de763..f3b89b09742f 100644
2.24.1 2.24.1
From 1ff29a280284753dbcb04358d52528cfe0838bca Mon Sep 17 00:00:00 2001 From 14e65803568dd37708a7b8ff783d4ae81d28d013 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 3 May 2018 16:49:28 +0200 Date: Thu, 3 May 2018 16:49:28 +0200
Subject: [PATCH 06/17] screen: Track the current foreground process Subject: [PATCH 05/16] screen: Track the current foreground process
... using the interactive shell's precmd and preexec hooks, by ... using the interactive shell's precmd and preexec hooks, by
monitoring the contents of the terminal, and a combination of monitoring the contents of the terminal, and a combination of
@ -772,10 +754,10 @@ index f3b89b09742f..6fc6ad470102 100644
2.24.1 2.24.1
From b2994f1a0d4e6638490a1ec06bb9f7dcadc40ba3 Mon Sep 17 00:00:00 2001 From f537c820e914789da39fb584fe62314f5a4eb57a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 10 May 2018 19:23:16 +0200 Date: Thu, 10 May 2018 19:23:16 +0200
Subject: [PATCH 07/17] Notify when a long-running foreground process group Subject: [PATCH 06/16] Notify when a long-running foreground process group
terminates terminates
Notifications are only sent if the VteTerminal in which the process Notifications are only sent if the VteTerminal in which the process
@ -786,12 +768,30 @@ notification is sent.
https://bugzilla.gnome.org/show_bug.cgi?id=711059 https://bugzilla.gnome.org/show_bug.cgi?id=711059
--- ---
configure.ac | 6 +--
src/terminal-app.c | 32 ++++++++++++ src/terminal-app.c | 32 ++++++++++++
src/terminal-screen.c | 105 +++++++++++++++++++++++++++++++++++++++ src/terminal-screen.c | 109 +++++++++++++++++++++++++++++++++++++++
src/terminal-tab-label.c | 30 ++++++++++- src/terminal-tab-label.c | 30 ++++++++++-
src/terminal-tab-label.h | 4 ++ src/terminal-tab-label.h | 4 ++
4 files changed, 170 insertions(+), 1 deletion(-) 5 files changed, 177 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2130f9262251..a889e03227b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,9 +37,9 @@ AM_GNU_GETTEXT([external])
AX_PTHREAD([],[AC_MSG_ERROR([pthreads are required])])
-GLIB_REQUIRED=2.50.0
-GLIB_MIN_REQUIRED=2.50
-GLIB_MAX_ALLOWED=2.50
+GLIB_REQUIRED=2.52.0
+GLIB_MIN_REQUIRED=2.52
+GLIB_MAX_ALLOWED=2.52
GIO_REQUIRED=2.34.0
GIO_UNIX_REQUIRED=2.34.0
diff --git a/src/terminal-app.c b/src/terminal-app.c diff --git a/src/terminal-app.c b/src/terminal-app.c
index 6a4fe03f2756..4e70facf9a43 100644 index 6a4fe03f2756..4e70facf9a43 100644
--- a/src/terminal-app.c --- a/src/terminal-app.c
@ -850,7 +850,7 @@ index 6a4fe03f2756..4e70facf9a43 100644
app_load_css (application); app_load_css (application);
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 6fc6ad470102..513610f5d83a 100644 index 6fc6ad470102..87bba46f0660 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -54,6 +54,7 @@ @@ -54,6 +54,7 @@
@ -937,7 +937,7 @@ index 6fc6ad470102..513610f5d83a 100644
/** /**
* terminal_screen_get_current_dir: * terminal_screen_get_current_dir:
* @screen: * @screen:
@@ -2077,6 +2126,59 @@ terminal_screen_contents_changed (VteTerminal *terminal) @@ -2077,6 +2126,63 @@ terminal_screen_contents_changed (VteTerminal *terminal)
screen); screen);
} }
@ -981,10 +981,14 @@ index 6fc6ad470102..513610f5d83a 100644
+ { + {
+ gs_unref_object GNotification *notification = NULL; + gs_unref_object GNotification *notification = NULL;
+ TerminalApp *app; + TerminalApp *app;
+ gs_free char *current_cmdline_valid = NULL;
+ gs_free char *detailed_action = NULL; + gs_free char *detailed_action = NULL;
+ +
+ notification = g_notification_new (_("Command completed")); + notification = g_notification_new (_("Command completed"));
+ g_notification_set_body (notification, priv->current_cmdline); +
+ current_cmdline_valid = g_utf8_make_valid (priv->current_cmdline, -1);
+ g_notification_set_body (notification, current_cmdline_valid);
+
+ detailed_action = g_strdup_printf ("app.activate-tab::%s", priv->uuid); + detailed_action = g_strdup_printf ("app.activate-tab::%s", priv->uuid);
+ g_notification_set_default_action (notification, detailed_action); + g_notification_set_default_action (notification, detailed_action);
+ +
@ -997,7 +1001,7 @@ index 6fc6ad470102..513610f5d83a 100644
static void static void
terminal_screen_shell_precmd (VteTerminal *terminal) terminal_screen_shell_precmd (VteTerminal *terminal)
{ {
@@ -2099,6 +2201,9 @@ terminal_screen_shell_precmd (VteTerminal *terminal) @@ -2099,6 +2205,9 @@ terminal_screen_shell_precmd (VteTerminal *terminal)
priv->shell_preexec_source_id = 0; priv->shell_preexec_source_id = 0;
} }
@ -1088,10 +1092,10 @@ index 20cfbceb36b0..a987025e0524 100644
2.24.1 2.24.1
From f6ea65d40203fbb5a6205b9b9ac4c71098db3722 Mon Sep 17 00:00:00 2001 From 6c4474a733da508eeabc926316b21584273b8e35 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 10 Apr 2018 15:39:35 +0200 Date: Tue, 10 Apr 2018 15:39:35 +0200
Subject: [PATCH 08/17] profile: Split the Command tab into two nested GtkGrids Subject: [PATCH 07/16] profile: Split the Command tab into two nested GtkGrids
This will let the subsequent patch add a "Command" sub-heading to keep This will let the subsequent patch add a "Command" sub-heading to keep
the command settings separate from the to-be-restored title settings. the command settings separate from the to-be-restored title settings.
@ -1363,10 +1367,10 @@ index 6526c4ff4832..0fc1c867d42e 100644
2.24.1 2.24.1
From c36887091defc052ce89cd283951702174142f64 Mon Sep 17 00:00:00 2001 From 8b5a163aa4587e5e39f2845ba009103425f26a32 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 10 Apr 2018 16:01:51 +0200 Date: Tue, 10 Apr 2018 16:01:51 +0200
Subject: [PATCH 09/17] Revert "profile: Remove the "Command" sub-heading" Subject: [PATCH 08/16] Revert "profile: Remove the "Command" sub-heading"
This reverts commit 8e27479299d075df0a52d0e8e7baeab344dcaa6c. This reverts commit 8e27479299d075df0a52d0e8e7baeab344dcaa6c.
@ -1656,10 +1660,10 @@ index 0fc1c867d42e..70c9e6ad0bad 100644
2.24.1 2.24.1
From e263aa22d3b461ce4e105a53f0112613baf27379 Mon Sep 17 00:00:00 2001 From dd6d9ff8b0f85cedbb21fd5b46912637fca59fe2 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 30 Jun 2016 16:02:13 +0200 Date: Thu, 30 Jun 2016 16:02:13 +0200
Subject: [PATCH 10/17] Revert "screen: Remove unused description and Subject: [PATCH 09/16] Revert "screen: Remove unused description and
user_title API" user_title API"
This reverts commit 3bb41272b7509a16ec2a5cd93e44f73d5743b626. This reverts commit 3bb41272b7509a16ec2a5cd93e44f73d5743b626.
@ -1671,7 +1675,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1296110
2 files changed, 68 insertions(+) 2 files changed, 68 insertions(+)
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 513610f5d83a..7cbb347e0f90 100644 index 87bba46f0660..bf6695b69a43 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -114,6 +114,7 @@ struct _TerminalScreenPrivate @@ -114,6 +114,7 @@ struct _TerminalScreenPrivate
@ -1835,10 +1839,10 @@ index 8ea337867222..049bbe5a2b8b 100644
2.24.1 2.24.1
From fdf73dcbb6710c756377af0db36f0d89b08f6914 Mon Sep 17 00:00:00 2001 From 299898f7017a8dfb8c84f42e1715e08adcbe2325 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 30 Jun 2016 17:39:48 +0200 Date: Thu, 30 Jun 2016 17:39:48 +0200
Subject: [PATCH 11/17] Revert "Remove the static title setting from profile Subject: [PATCH 10/16] Revert "Remove the static title setting from profile
preferences" preferences"
This reverts commit e9cb8fea14a849704074c5d69f173bcf4dc2fb27. This reverts commit e9cb8fea14a849704074c5d69f173bcf4dc2fb27.
@ -1979,7 +1983,7 @@ index c9e7c895d700..a52bfdb1b5c3 100644
#define TERMINAL_PROFILE_USE_SKEY_KEY "use-skey" #define TERMINAL_PROFILE_USE_SKEY_KEY "use-skey"
#define TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY "use-system-font" #define TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY "use-system-font"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 7cbb347e0f90..b7439fa056db 100644 index bf6695b69a43..c5683799aabf 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -1058,11 +1058,14 @@ char * @@ -1058,11 +1058,14 @@ char *
@ -2014,10 +2018,10 @@ index 7cbb347e0f90..b7439fa056db 100644
2.24.1 2.24.1
From 95e85dd1774dea9f61909a9f083d67f3a1c6c964 Mon Sep 17 00:00:00 2001 From 6be492b810c701759ebc40bd6b3368a8485b1c3a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 17 Feb 2015 17:06:17 +0100 Date: Tue, 17 Feb 2015 17:06:17 +0100
Subject: [PATCH 12/17] Restore translations for setting a title and Subject: [PATCH 11/16] Restore translations for setting a title and
transparency transparency
--- ---
@ -3223,11 +3227,11 @@ index 9d37f273ac6b..764008affd95 100644
+msgid "Set Title" +msgid "Set Title"
+msgstr "Atur Judul" +msgstr "Atur Judul"
diff --git a/po/it.po b/po/it.po diff --git a/po/it.po b/po/it.po
index d4a31c1c8b13..fe2766ebaa06 100644 index e08dfae8009c..b224bbdc1f3a 100644
--- a/po/it.po --- a/po/it.po
+++ b/po/it.po +++ b/po/it.po
@@ -2340,3 +2340,15 @@ msgstr "" @@ -2434,3 +2434,15 @@ msgstr ""
#: ../src/terminal-window.c:3256 #: src/terminal-window.c:3224
msgid "C_lose Window" msgid "C_lose Window"
msgstr "Chiudi _finestra" msgstr "Chiudi _finestra"
+ +
@ -4784,10 +4788,10 @@ index 0ef3bb80be49..5c162706fa7b 100644
2.24.1 2.24.1
From ce2fca0227016323e69221294dac93ff1d482b46 Mon Sep 17 00:00:00 2001 From 2bcdc2f36181c8f39eca7353b0aa7f6bb6599e4b Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 25 May 2016 13:47:36 +0200 Date: Wed, 25 May 2016 13:47:36 +0200
Subject: [PATCH 13/17] Restore the action and shortcut to set a static title Subject: [PATCH 12/16] Restore the action and shortcut to set a static title
from the menus from the menus
This reverts 9bbe19e98f62aa3c9020913a3a5a8080a5177505 with various This reverts 9bbe19e98f62aa3c9020913a3a5a8080a5177505 with various
@ -4932,10 +4936,10 @@ index c0219d872725..61c5e7de350a 100644
2.24.1 2.24.1
From a7dee120d9e1616484c331f1cbe3da77311fa3d8 Mon Sep 17 00:00:00 2001 From 9726ebf2d8d93958c263787f5e8f4022f6a6c117 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 30 Jun 2016 18:14:36 +0200 Date: Thu, 30 Jun 2016 18:14:36 +0200
Subject: [PATCH 14/17] screen: Style fix Subject: [PATCH 13/16] screen: Style fix
This brings the code in line with how it was before This brings the code in line with how it was before
de0dc7c2649c42e2aa02a66e4be27d262b34452d de0dc7c2649c42e2aa02a66e4be27d262b34452d
@ -4946,7 +4950,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1296110
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index b7439fa056db..118ccbd5ef18 100644 index c5683799aabf..92e01c5d6bee 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -833,7 +833,7 @@ terminal_screen_new (GSettings *profile, @@ -833,7 +833,7 @@ terminal_screen_new (GSettings *profile,
@ -4962,10 +4966,10 @@ index b7439fa056db..118ccbd5ef18 100644
2.24.1 2.24.1
From d342e6a8f2ee35413d3ee35a696407f2617ed2d3 Mon Sep 17 00:00:00 2001 From 512681bc893adccf1239ea495ca26f0db5eb05a1 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 30 Jun 2016 16:58:15 +0200 Date: Thu, 30 Jun 2016 16:58:15 +0200
Subject: [PATCH 15/17] Restore the rest of the title handling options and make Subject: [PATCH 14/16] Restore the rest of the title handling options and make
it all work it all work
This reverts commit f27bf0135a2d18ba22158d28bf1f8c5f6ec066c8 and makes This reverts commit f27bf0135a2d18ba22158d28bf1f8c5f6ec066c8 and makes
@ -4980,8 +4984,8 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1296110
src/terminal-schemas.h | 1 + src/terminal-schemas.h | 1 +
src/terminal-screen.c | 257 +++++++++++++++++++++-------- src/terminal-screen.c | 257 +++++++++++++++++++++--------
src/terminal-screen.h | 8 +- src/terminal-screen.h | 8 +-
src/terminal-window.c | 11 +- src/terminal-window.c | 9 +-
8 files changed, 263 insertions(+), 76 deletions(-) 8 files changed, 263 insertions(+), 74 deletions(-)
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 0eeb141694b1..bca411f7bcc7 100644 index 0eeb141694b1..bca411f7bcc7 100644
@ -5116,7 +5120,7 @@ index a52bfdb1b5c3..d03c983ed858 100644
#define TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY "use-custom-command" #define TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY "use-custom-command"
#define TERMINAL_PROFILE_USE_SKEY_KEY "use-skey" #define TERMINAL_PROFILE_USE_SKEY_KEY "use-skey"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 118ccbd5ef18..597e28e41712 100644 index 92e01c5d6bee..5db513d0c26f 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -113,8 +113,11 @@ struct _TerminalScreenPrivate @@ -113,8 +113,11 @@ struct _TerminalScreenPrivate
@ -5549,7 +5553,7 @@ index 049bbe5a2b8b..5b7fcc59ddd0 100644
void terminal_screen_get_size (TerminalScreen *screen, void terminal_screen_get_size (TerminalScreen *screen,
diff --git a/src/terminal-window.c b/src/terminal-window.c diff --git a/src/terminal-window.c b/src/terminal-window.c
index 61c5e7de350a..5294e4afc308 100644 index 61c5e7de350a..0d61db3c125d 100644
--- a/src/terminal-window.c --- a/src/terminal-window.c
+++ b/src/terminal-window.c +++ b/src/terminal-window.c
@@ -767,6 +767,12 @@ terminal_set_title_dialog_response_cb (GtkWidget *dialog, @@ -767,6 +767,12 @@ terminal_set_title_dialog_response_cb (GtkWidget *dialog,
@ -5565,19 +5569,13 @@ index 61c5e7de350a..5294e4afc308 100644
static void static void
action_set_title_cb (GSimpleAction *action, action_set_title_cb (GSimpleAction *action,
GVariant *parameter, GVariant *parameter,
@@ -2515,14 +2521,11 @@ sync_screen_title (TerminalScreen *screen, @@ -2521,8 +2527,7 @@ sync_screen_title (TerminalScreen *screen,
TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;
- const char *title;
if (screen != priv->active_screen)
return; return;
- title = terminal_screen_get_title (screen); title = terminal_screen_get_title (screen);
- gtk_window_set_title (GTK_WINDOW (window), - gtk_window_set_title (GTK_WINDOW (window),
- title && title[0] ? title : _("Terminal")); - title && title[0] ? title : _("Terminal"));
+ gtk_window_set_title (GTK_WINDOW (window), terminal_screen_get_title (screen)); + gtk_window_set_title (GTK_WINDOW (window), title);
} }
static void static void
@ -5585,17 +5583,19 @@ index 61c5e7de350a..5294e4afc308 100644
2.24.1 2.24.1
From 6d394ff6c2caf0b4e98063bd9711bdb35a44d990 Mon Sep 17 00:00:00 2001 From dd89c1d173f1ec7b276517afb9e78238e8912400 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 3 Apr 2019 15:38:09 +0200 Date: Wed, 3 Apr 2019 15:38:09 +0200
Subject: [PATCH 16/17] Update the title with the current foreground process Subject: [PATCH 15/16] Update the title with the current foreground process
Some changes by Bill Nottingham <notting@splat.cc>
https://bugzilla.gnome.org/show_bug.cgi?id=711060 https://bugzilla.gnome.org/show_bug.cgi?id=711060
--- ---
src/org.gnome.Terminal.gschema.xml | 5 +++++ src/org.gnome.Terminal.gschema.xml | 5 ++++
src/terminal-schemas.h | 1 + src/terminal-schemas.h | 1 +
src/terminal-screen.c | 34 +++++++++++++++++++++++++++++- src/terminal-screen.c | 39 +++++++++++++++++++++++++++++-
3 files changed, 39 insertions(+), 1 deletion(-) 3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index bca411f7bcc7..630647c75301 100644 index bca411f7bcc7..630647c75301 100644
@ -5626,7 +5626,7 @@ index d03c983ed858..8d8b34fdbbab 100644
#define TERMINAL_PROFILE_TITLE_MODE_KEY "title-mode" #define TERMINAL_PROFILE_TITLE_MODE_KEY "title-mode"
#define TERMINAL_PROFILE_TITLE_KEY "title" #define TERMINAL_PROFILE_TITLE_KEY "title"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 597e28e41712..43b1d4a1c48e 100644 index 5db513d0c26f..575797e30f38 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -112,7 +112,9 @@ struct _TerminalScreenPrivate @@ -112,7 +112,9 @@ struct _TerminalScreenPrivate
@ -5639,7 +5639,7 @@ index 597e28e41712..43b1d4a1c48e 100644
gboolean user_title; /* title was manually set */ gboolean user_title; /* title was manually set */
char *current_cmdline; char *current_cmdline;
char *raw_title; char *raw_title;
@@ -1144,6 +1146,15 @@ terminal_screen_format_title (TerminalScreen *screen, @@ -1144,6 +1146,20 @@ terminal_screen_format_title (TerminalScreen *screen,
add_sep = FALSE; add_sep = FALSE;
} }
@ -5649,13 +5649,18 @@ index 597e28e41712..43b1d4a1c48e 100644
+ priv->current_cmdline != NULL && + priv->current_cmdline != NULL &&
+ priv->current_cmdline[0] != '\0') + priv->current_cmdline[0] != '\0')
+ { + {
+ g_string_append_printf (title, " — %s", priv->current_cmdline); + gs_free char *current_cmdline_truncated = NULL;
+ gs_free char *current_cmdline_valid = NULL;
+
+ current_cmdline_valid = g_utf8_make_valid (priv->current_cmdline, -1);
+ current_cmdline_truncated = g_utf8_substring (current_cmdline_valid, 0, 1024);
+ g_string_append_printf (title, " — %s", current_cmdline_truncated);
+ } + }
+ +
if (*titleptr == NULL || strcmp (title->str, *titleptr) != 0) if (*titleptr == NULL || strcmp (title->str, *titleptr) != 0)
{ {
g_free (*titleptr); g_free (*titleptr);
@@ -1173,6 +1184,7 @@ terminal_screen_profile_changed_cb (GSettings *profile, @@ -1173,6 +1189,7 @@ terminal_screen_profile_changed_cb (GSettings *profile,
GObject *object = G_OBJECT (screen); GObject *object = G_OBJECT (screen);
VteTerminal *vte_terminal = VTE_TERMINAL (screen); VteTerminal *vte_terminal = VTE_TERMINAL (screen);
TerminalWindow *window; TerminalWindow *window;
@ -5663,7 +5668,7 @@ index 597e28e41712..43b1d4a1c48e 100644
g_object_freeze_notify (object); g_object_freeze_notify (object);
@@ -1207,7 +1219,7 @@ terminal_screen_profile_changed_cb (GSettings *profile, @@ -1207,7 +1224,7 @@ terminal_screen_profile_changed_cb (GSettings *profile,
prop_name == I_(TERMINAL_PROFILE_TITLE_MODE_KEY) || prop_name == I_(TERMINAL_PROFILE_TITLE_MODE_KEY) ||
prop_name == I_(TERMINAL_PROFILE_TITLE_KEY)) prop_name == I_(TERMINAL_PROFILE_TITLE_KEY))
{ {
@ -5672,7 +5677,7 @@ index 597e28e41712..43b1d4a1c48e 100644
} }
if (gtk_widget_get_realized (GTK_WIDGET (screen)) && if (gtk_widget_get_realized (GTK_WIDGET (screen)) &&
@@ -1235,6 +1247,13 @@ terminal_screen_profile_changed_cb (GSettings *profile, @@ -1235,6 +1252,13 @@ terminal_screen_profile_changed_cb (GSettings *profile,
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT)) prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT))
update_color_scheme (screen); update_color_scheme (screen);
@ -5686,7 +5691,7 @@ index 597e28e41712..43b1d4a1c48e 100644
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_AUDIBLE_BELL_KEY)) if (!prop_name || prop_name == I_(TERMINAL_PROFILE_AUDIBLE_BELL_KEY))
vte_terminal_set_audible_bell (vte_terminal, g_settings_get_boolean (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY)); vte_terminal_set_audible_bell (vte_terminal, g_settings_get_boolean (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY));
@@ -1295,6 +1314,9 @@ terminal_screen_profile_changed_cb (GSettings *profile, @@ -1295,6 +1319,9 @@ terminal_screen_profile_changed_cb (GSettings *profile,
vte_terminal_set_word_char_exceptions (vte_terminal, word_char_exceptions); vte_terminal_set_word_char_exceptions (vte_terminal, word_char_exceptions);
} }
@ -5696,7 +5701,7 @@ index 597e28e41712..43b1d4a1c48e 100644
g_object_thaw_notify (object); g_object_thaw_notify (object);
} }
@@ -2184,6 +2206,9 @@ static void @@ -2184,6 +2211,9 @@ static void
terminal_screen_window_title_changed (VteTerminal *vte_terminal, terminal_screen_window_title_changed (VteTerminal *vte_terminal,
TerminalScreen *screen) TerminalScreen *screen)
{ {
@ -5706,7 +5711,7 @@ index 597e28e41712..43b1d4a1c48e 100644
terminal_screen_set_dynamic_title (screen, terminal_screen_set_dynamic_title (screen,
vte_terminal_get_window_title (vte_terminal), vte_terminal_get_window_title (vte_terminal),
FALSE); FALSE);
@@ -2290,6 +2315,8 @@ terminal_screen_contents_changed_cb (TerminalScreen *screen) @@ -2290,6 +2320,8 @@ terminal_screen_contents_changed_cb (TerminalScreen *screen)
priv->current_cmdline = g_steal_pointer (&cmdline); priv->current_cmdline = g_steal_pointer (&cmdline);
_terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: %s\n", priv->current_cmdline); _terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: %s\n", priv->current_cmdline);
@ -5715,7 +5720,7 @@ index 597e28e41712..43b1d4a1c48e 100644
out: out:
priv->contents_changed_source_id = 0; priv->contents_changed_source_id = 0;
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@@ -2378,6 +2405,7 @@ terminal_screen_shell_precmd (VteTerminal *terminal) @@ -2382,6 +2414,7 @@ terminal_screen_shell_precmd (VteTerminal *terminal)
_terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Shell precmd\n"); _terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Shell precmd\n");
@ -5723,7 +5728,7 @@ index 597e28e41712..43b1d4a1c48e 100644
priv->between_preexec_and_precmd = FALSE; priv->between_preexec_and_precmd = FALSE;
if (priv->contents_changed_source_id != 0) if (priv->contents_changed_source_id != 0)
@@ -2397,6 +2425,8 @@ terminal_screen_shell_precmd (VteTerminal *terminal) @@ -2401,6 +2434,8 @@ terminal_screen_shell_precmd (VteTerminal *terminal)
g_clear_pointer (&priv->current_cmdline, g_free); g_clear_pointer (&priv->current_cmdline, g_free);
_terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: (none)\n"); _terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: (none)\n");
@ -5732,7 +5737,7 @@ index 597e28e41712..43b1d4a1c48e 100644
} }
static gboolean static gboolean
@@ -2417,6 +2447,8 @@ terminal_screen_shell_preexec_cb (TerminalScreen *screen) @@ -2421,6 +2456,8 @@ terminal_screen_shell_preexec_cb (TerminalScreen *screen)
priv->current_cmdline = g_steal_pointer (&cmdline); priv->current_cmdline = g_steal_pointer (&cmdline);
_terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: %s\n", priv->current_cmdline); _terminal_debug_print (TERMINAL_DEBUG_SHELL_COMMAND, "Current foreground command-line: %s\n", priv->current_cmdline);
@ -5745,10 +5750,10 @@ index 597e28e41712..43b1d4a1c48e 100644
2.24.1 2.24.1
From fdcbfd315c4ec1e9a1b0c7d6173437202764feee Mon Sep 17 00:00:00 2001 From 9c1338c23458ef7112be6f0c3a049b404ea12bbf Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org> From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 27 Feb 2020 19:32:08 +0100 Date: Thu, 27 Feb 2020 19:32:08 +0100
Subject: [PATCH 17/17] screen, window: Preserve current toolbox, if any Subject: [PATCH 16/16] screen, window: Preserve current toolbox, if any
This relies on toolbox(1) emitting a terminal escape sequence that This relies on toolbox(1) emitting a terminal escape sequence that
advertises the name of the current toolbox container. advertises the name of the current toolbox container.
@ -5761,7 +5766,7 @@ https://gitlab.freedesktop.org/terminal-wg/specifications/issues/17
3 files changed, 46 insertions(+), 2 deletions(-) 3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/src/terminal-screen.c b/src/terminal-screen.c diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 43b1d4a1c48e..69a36df14ebf 100644 index 575797e30f38..cd7e19215fea 100644
--- a/src/terminal-screen.c --- a/src/terminal-screen.c
+++ b/src/terminal-screen.c +++ b/src/terminal-screen.c
@@ -876,6 +876,20 @@ terminal_screen_reexec_from_screen (TerminalScreen *screen, @@ -876,6 +876,20 @@ terminal_screen_reexec_from_screen (TerminalScreen *screen,
@ -5816,7 +5821,7 @@ index 5b7fcc59ddd0..aca2ddd70820 100644
GSettings *profile); GSettings *profile);
GSettings* terminal_screen_get_profile (TerminalScreen *screen); GSettings* terminal_screen_get_profile (TerminalScreen *screen);
diff --git a/src/terminal-window.c b/src/terminal-window.c diff --git a/src/terminal-window.c b/src/terminal-window.c
index 5294e4afc308..aaecf8bf8ec0 100644 index 0d61db3c125d..9bb3faac6ad9 100644
--- a/src/terminal-window.c --- a/src/terminal-window.c
+++ b/src/terminal-window.c +++ b/src/terminal-window.c
@@ -405,8 +405,26 @@ action_new_terminal_cb (GSimpleAction *action, @@ -405,8 +405,26 @@ action_new_terminal_cb (GSimpleAction *action,

View File

@ -8,7 +8,7 @@
Name: gnome-terminal Name: gnome-terminal
Version: 3.35.92 Version: 3.35.92
Release: 1%{?dist} Release: 2%{?dist}
Summary: Terminal emulator for GNOME Summary: Terminal emulator for GNOME
License: GPLv3+ and GFDL and LGPLv2+ License: GPLv3+ and GFDL and LGPLv2+
@ -109,6 +109,9 @@ make check
%{_datadir}/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml %{_datadir}/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml
%changelog %changelog
* Thu Mar 05 2020 Debarshi Ray <rishi@fedoraproject.org> - 3.35.92-2
- Limit the command line to 1024 characters when used as the title
* Mon Mar 02 2020 Debarshi Ray <rishi@fedoraproject.org> - 3.35.92-1 * Mon Mar 02 2020 Debarshi Ray <rishi@fedoraproject.org> - 3.35.92-1
- Update to 3.35.92 - Update to 3.35.92