From 150fa9196e8e1ecda5439915c086c3f98cf51a1d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 20 Jun 2019 22:05:22 +0200 Subject: [PATCH] Preserve current toolbox, if any, when opening a new terminal --- ... gnome-terminal-cntr-ntfy-autottl-ts.patch | 164 ++++++++++++------ gnome-terminal.spec | 7 +- 2 files changed, 115 insertions(+), 56 deletions(-) rename gnome-terminal-notify-open-title-transparency.patch => gnome-terminal-cntr-ntfy-autottl-ts.patch (97%) diff --git a/gnome-terminal-notify-open-title-transparency.patch b/gnome-terminal-cntr-ntfy-autottl-ts.patch similarity index 97% rename from gnome-terminal-notify-open-title-transparency.patch rename to gnome-terminal-cntr-ntfy-autottl-ts.patch index d594bc4..fbe5807 100644 --- a/gnome-terminal-notify-open-title-transparency.patch +++ b/gnome-terminal-cntr-ntfy-autottl-ts.patch @@ -1,7 +1,7 @@ -From 163b7060214cdbacb91c62e48ed3d6a732e9dfa4 Mon Sep 17 00:00:00 2001 +From b87294e006afaa7417b68bc869ef3a3c0ebffc07 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 12 May 2014 14:57:18 +0200 -Subject: [PATCH 01/17] Restore transparency +Subject: [PATCH 01/18] Restore transparency The transparency settings were removed as a side effect of 2bff4b63ed3ceef6055e35563e9b0b33ad57349d @@ -231,13 +231,13 @@ index 19198f49f7b5..5ba767c5fc87 100644 uuid_unparse (u, uuidstr); priv->uuid = g_strdup (uuidstr); -- -2.21.0 +2.20.1 -From 96a1e3ca4f65222873397e9fc240cbae00ecd1c5 Mon Sep 17 00:00:00 2001 +From e6d5fe9d911008876330b8141c95c584f6c7fc16 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 28 May 2014 14:11:02 +0200 -Subject: [PATCH 02/17] window: Make the drawing robust across all themes +Subject: [PATCH 02/18] window: Make the drawing robust across all themes 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 @@ -293,13 +293,13 @@ index 5ba767c5fc87..cdd69f9f4f52 100644 widget_class->screen_changed = terminal_window_screen_changed; widget_class->style_updated = terminal_window_style_updated; -- -2.21.0 +2.20.1 -From 502f2162a07f06d54b7f6b04b4a32e160868af7c Mon Sep 17 00:00:00 2001 +From c1fbed1804a5a8a40f65efb7bfb4f00a37961cb4 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 13 Nov 2015 15:16:42 +0100 -Subject: [PATCH 03/17] screen, window: Extra padding around transparent +Subject: [PATCH 03/18] screen, window: Extra padding around transparent terminals in Wayland https://bugzilla.redhat.com/show_bug.cgi?id=1207943 @@ -420,13 +420,13 @@ index cdd69f9f4f52..6028ca8700d7 100644 return GTK_WIDGET_CLASS (terminal_window_parent_class)->draw (widget, cr); -- -2.21.0 +2.20.1 -From 8fa18e1c345d0c96276a61fb8dfd7e782297b9ea Mon Sep 17 00:00:00 2001 +From de6fc6871c9bae0856c33e6a727bb5e8a77a1bf9 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 27 Feb 2017 16:53:51 +0100 -Subject: [PATCH 04/17] screen: Silence -Wunused variable +Subject: [PATCH 04/18] screen: Silence -Wunused variable https://bugzilla.redhat.com/show_bug.cgi?id=1207943 --- @@ -446,13 +446,13 @@ index c0ce8a89126c..1b763a3890dd 100644 gboolean use_theme_colors; -- -2.21.0 +2.20.1 -From 6ec8822170600d7dc798ee8e64f9d7ae33019722 Mon Sep 17 00:00:00 2001 +From c426267330d5b3521d96a7c07958680f206b74f1 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 18 May 2018 20:15:34 +0200 -Subject: [PATCH 05/17] screen: Try harder to find a foreground process group +Subject: [PATCH 05/18] screen: Try harder to find a foreground process group member For pipelined commands, it's possible that the process group leader, @@ -516,13 +516,13 @@ index 1b763a3890dd..db281cbf13c5 100644 #endif -- -2.21.0 +2.20.1 -From 282798e1c29df1e2792408c91cf4049732f0549e Mon Sep 17 00:00:00 2001 +From a78b03eee4c5f42aebf197d5619fbd6270d67b2f Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 3 May 2018 16:49:28 +0200 -Subject: [PATCH 06/17] screen: Track the current foreground process +Subject: [PATCH 06/18] screen: Track the current foreground process ... using the interactive shell's precmd and preexec hooks, by monitoring the contents of the terminal, and a combination of @@ -728,13 +728,13 @@ index db281cbf13c5..d03f82b092aa 100644 terminal_screen_drag_data_received (GtkWidget *widget, GdkDragContext *context, -- -2.21.0 +2.20.1 -From f0654447aff628001901a55b9b2b6fe151dbb2e6 Mon Sep 17 00:00:00 2001 +From eea40f74619165002e8ba5e8cc27b7115ea35acb Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 10 May 2018 19:23:16 +0200 -Subject: [PATCH 07/17] Notify when a long-running foreground process group +Subject: [PATCH 07/18] Notify when a long-running foreground process group terminates Notifications are only sent if the VteTerminal in which the process @@ -1043,13 +1043,13 @@ index 20cfbceb36b0..a987025e0524 100644 G_END_DECLS -- -2.21.0 +2.20.1 -From fc0e2e53fc17d04069d6738459b68e77988172a6 Mon Sep 17 00:00:00 2001 +From 5f2541b4d1cdb2a7f52fc9b0b40c32583311da88 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 2 Apr 2019 16:37:48 +0200 -Subject: [PATCH 08/17] Sprinkle debug messages for notifications +Subject: [PATCH 08/18] Sprinkle debug messages for notifications This can be useful for finding out whether the escape sequence wasn't emitted or the filtering was faulty. @@ -1137,13 +1137,13 @@ index 94b077cc7141..e58c69741c37 100644 priv->shell_preexec_source_id = 0; retval = G_SOURCE_REMOVE; -- -2.21.0 +2.20.1 -From 4299288c44b5d5d08f82dc2c74492df45440727e Mon Sep 17 00:00:00 2001 +From e2068064e1a1d32f54bb573a6aa1ab05981fcb93 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 10 Apr 2018 15:39:35 +0200 -Subject: [PATCH 09/17] profile: Split the Command tab into two nested GtkGrids +Subject: [PATCH 09/18] profile: Split the Command tab into two nested GtkGrids This will let the subsequent patch add a "Command" sub-heading to keep the command settings separate from the to-be-restored title settings. @@ -1344,13 +1344,13 @@ index 47f1cf8abce2..b35cf5e8999a 100644 -- -2.21.0 +2.20.1 -From 2d32883bda9611be20d2f7b7a179b62e9db98b11 Mon Sep 17 00:00:00 2001 +From 4cb47eeffdd2a2b130b1ba91fe8de85eb86e41ef Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 10 Apr 2018 16:01:51 +0200 -Subject: [PATCH 10/17] Revert "profile: Remove the "Command" sub-heading" +Subject: [PATCH 10/18] Revert "profile: Remove the "Command" sub-heading" This reverts commit 8e27479299d075df0a52d0e8e7baeab344dcaa6c. @@ -1568,13 +1568,13 @@ index b35cf5e8999a..a4b2027ff300 100644 -- -2.21.0 +2.20.1 -From 9e090d3fd109974ce7fc1e5b98b19ddb18af393b Mon Sep 17 00:00:00 2001 +From be6152b01aaf0131b3ed06af1aac868c5948a587 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 30 Jun 2016 16:02:13 +0200 -Subject: [PATCH 11/17] Revert "screen: Remove unused description and +Subject: [PATCH 11/18] Revert "screen: Remove unused description and user_title API" This reverts commit 3bb41272b7509a16ec2a5cd93e44f73d5743b626. @@ -1747,13 +1747,13 @@ index ff77fcf78947..af9583e7cbaf 100644 char *terminal_screen_get_current_dir (TerminalScreen *screen); -- -2.21.0 +2.20.1 -From 5ea2912840bd10237f87c0064b38e01ffc30f11d Mon Sep 17 00:00:00 2001 +From aaa1db2671ada1184f5cc2270cd9aebf445181b2 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 30 Jun 2016 17:39:48 +0200 -Subject: [PATCH 12/17] Revert "Remove the static title setting from profile +Subject: [PATCH 12/18] Revert "Remove the static title setting from profile preferences" This reverts commit e9cb8fea14a849704074c5d69f173bcf4dc2fb27. @@ -1926,13 +1926,13 @@ index 4e3f7606b85a..077f6b5fa042 100644 (!prop_name || prop_name == I_(TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY) || -- -2.21.0 +2.20.1 -From cbff896fc3626d60bcc4930fd21e4caa71a09061 Mon Sep 17 00:00:00 2001 +From a4ec1a45e29805babb614c0ce6222ab687625241 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 17 Feb 2015 17:06:17 +0100 -Subject: [PATCH 13/17] Restore translations for setting a title and +Subject: [PATCH 13/18] Restore translations for setting a title and transparency --- @@ -4619,10 +4619,10 @@ index 44a8e21c7842..12aa6d190d99 100644 #: ../src/terminal-window.c:986 msgid "Set _Character Encoding" diff --git a/po/zh_CN.po b/po/zh_CN.po -index 6c80dcd1231a..51e5f9999176 100644 +index 3d6403609493..7a053e7a86ef 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po -@@ -2580,17 +2580,17 @@ msgstr "关闭窗口(_L)" +@@ -2600,17 +2600,17 @@ msgstr "关闭窗口(_L)" #~ msgid "Default size:" #~ msgstr "默认大小:" @@ -4646,7 +4646,7 @@ index 6c80dcd1231a..51e5f9999176 100644 #~ msgid "Current Locale" #~ msgstr "当前区域" -@@ -2703,3 +2703,6 @@ msgstr "关闭窗口(_L)" +@@ -2723,3 +2723,6 @@ msgstr "关闭窗口(_L)" #~ msgid "_Find..." #~ msgstr "查找(_F)..." @@ -4724,13 +4724,13 @@ index e740ebc6df0b..2fa8c3236b8f 100644 +msgid "Transparent background" +msgstr "透明背景" -- -2.21.0 +2.20.1 -From bfd7eaa03757ef203980b9fc5867cf445ae3305d Mon Sep 17 00:00:00 2001 +From 82d9e539e359f2e9b5aa8edf61fa407c4a9b8e14 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 25 May 2016 13:47:36 +0200 -Subject: [PATCH 14/17] Restore the action and shortcut to set a static title +Subject: [PATCH 14/18] Restore the action and shortcut to set a static title from the menus This reverts 9bbe19e98f62aa3c9020913a3a5a8080a5177505 with various @@ -4872,13 +4872,13 @@ index 6028ca8700d7..7fda0fe5128e 100644 { "tab-detach", action_tab_detach_cb, NULL, NULL, NULL }, { "tab-move-left", action_tab_move_left_cb, NULL, NULL, NULL }, -- -2.21.0 +2.20.1 -From 8041455f5b4ccb65a5bde20866443d4a060d2e04 Mon Sep 17 00:00:00 2001 +From 72a0e2496fa30a94effab9ae05302e2f795eea7d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 30 Jun 2016 18:14:36 +0200 -Subject: [PATCH 15/17] screen: Style fix +Subject: [PATCH 15/18] screen: Style fix This brings the code in line with how it was before de0dc7c2649c42e2aa02a66e4be27d262b34452d @@ -4902,13 +4902,13 @@ index 077f6b5fa042..3a49baa07a3f 100644 const char *p; -- -2.21.0 +2.20.1 -From 56bcdedb2fcff8eb42a277e7b55aadc4ecfff1b6 Mon Sep 17 00:00:00 2001 +From 23dbfde86385770d30d918ec39d229177995d1fc Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 30 Jun 2016 16:58:15 +0200 -Subject: [PATCH 16/17] Restore the rest of the title handling options and make +Subject: [PATCH 16/18] Restore the rest of the title handling options and make it all work This reverts commit f27bf0135a2d18ba22158d28bf1f8c5f6ec066c8 and makes @@ -5537,13 +5537,13 @@ index 7fda0fe5128e..6f81c7da4a66 100644 static void -- -2.21.0 +2.20.1 -From b812ddc98cabdb3c2df5639fab42ae62847f32d5 Mon Sep 17 00:00:00 2001 +From cf173a55962e57e4cec5d01baf75798492f01bf5 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 3 Apr 2019 15:38:09 +0200 -Subject: [PATCH 17/17] Update the title with the current foreground process +Subject: [PATCH 17/18] Update the title with the current foreground process https://bugzilla.gnome.org/show_bug.cgi?id=711060 --- @@ -5696,5 +5696,61 @@ index c6062d78edf6..9b7a1b50f0c7 100644 retval = G_SOURCE_REMOVE; -- -2.21.0 +2.20.1 + + +From 55eb6615160fc9694d970003a7136865efeabdef Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Tue, 18 Jun 2019 19:47:14 +0200 +Subject: [PATCH 18/18] window: Preserve current toolbox, if any, when opening + a new terminal + +This relies on toolbox(1) emitting a terminal escape sequence that +advertises the name of the current toolbox container. + +https://gitlab.freedesktop.org/terminal-wg/specifications/issues/17 +--- + src/terminal-window.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/src/terminal-window.c b/src/terminal-window.c +index 6f81c7da4a66..58f69ae9173d 100644 +--- a/src/terminal-window.c ++++ b/src/terminal-window.c +@@ -344,7 +344,10 @@ action_new_terminal_cb (GSimpleAction *action, + TerminalApp *app; + TerminalSettingsList *profiles_list; + gs_unref_object GSettings *profile = NULL; ++ const char *container_name; ++ const char *container_runtime; + gs_free char *new_working_directory = NULL; ++ gs_strfreev char **override_command = NULL; + gboolean can_toggle = FALSE; + + g_assert (TERMINAL_IS_WINDOW (window)); +@@ -399,9 +402,21 @@ action_new_terminal_cb (GSimpleAction *action, + if (mode == TERMINAL_NEW_TERMINAL_MODE_WINDOW) + window = terminal_app_new_window (app, 0); + ++ container_name = vte_terminal_get_current_container_name (VTE_TERMINAL (priv->active_screen)); ++ container_runtime = vte_terminal_get_current_container_runtime (VTE_TERMINAL (priv->active_screen)); ++ if (g_strcmp0 (container_runtime, "toolbox") == 0 && container_name != NULL && container_name[0] != '\0') ++ { ++ gs_free_error GError *error = NULL; ++ gs_free char *override_command_str = NULL; ++ ++ override_command_str = g_strdup_printf ("toolbox enter --container %s", container_name); ++ if (!g_shell_parse_argv (override_command_str, NULL, &override_command, &error)) ++ g_printerr ("Failed to parse '%s': %s\n", override_command_str, error->message); ++ } ++ + new_working_directory = terminal_screen_get_current_dir (priv->active_screen); + terminal_app_new_terminal (app, window, profile, NULL /* use profile encoding */, +- NULL, NULL, ++ override_command, NULL, + new_working_directory, + terminal_screen_get_initial_environment (priv->active_screen), + 1.0); +-- +2.20.1 diff --git a/gnome-terminal.spec b/gnome-terminal.spec index 1434fe8..709aa86 100644 --- a/gnome-terminal.spec +++ b/gnome-terminal.spec @@ -7,7 +7,7 @@ Name: gnome-terminal Version: 3.32.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Terminal emulator for GNOME License: GPLv3+ and GFDL and LGPLv2+ @@ -15,7 +15,7 @@ URL: http://www.gnome.org/ Source0: http://download.gnome.org/sources/gnome-terminal/3.32/gnome-terminal-%{version}.tar.xz Source1: org.gnome.Terminal.gschema.override -Patch100: gnome-terminal-notify-open-title-transparency.patch +Patch100: gnome-terminal-cntr-ntfy-autottl-ts.patch Patch101: 0001-build-Don-t-treat-warnings-as-errors.patch BuildRequires: glib2-devel >= %{glib2_version} @@ -106,6 +106,9 @@ make check %{_datadir}/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml %changelog +* Thu Jun 20 2019 Debarshi Ray - 3.32.2-2 +- Preserve current toolbox, if any, when opening a new terminal + * Tue May 07 2019 Kalev Lember - 3.32.2-1 - Update to 3.32.2