r45062 - in /desktop/jessie/gnome-terminal/debian: changelog control patches/Provide-fallback-for-reading-current-directory-if-OS.patch patches/series
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Sat Jun 13 10:51:08 UTC 2015
Author: biebl
Date: Sat Jun 13 10:51:08 2015
New Revision: 45062
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=45062
Log:
Provide fallback for reading current directory if OSC 7 fails. In Debian
there is no mechanism (yet) to source scripts for non-login interactive
shells so we can't rely on /etc/profile.d/vte*.sh but instead fallback to
reading /proc to determine the working directory of the current tab.
(Closes: #706065)
Added:
desktop/jessie/gnome-terminal/debian/patches/Provide-fallback-for-reading-current-directory-if-OS.patch
Modified:
desktop/jessie/gnome-terminal/debian/changelog
desktop/jessie/gnome-terminal/debian/control
desktop/jessie/gnome-terminal/debian/patches/series
Modified: desktop/jessie/gnome-terminal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/jessie/gnome-terminal/debian/changelog?rev=45062&op=diff
==============================================================================
--- desktop/jessie/gnome-terminal/debian/changelog [utf-8] (original)
+++ desktop/jessie/gnome-terminal/debian/changelog [utf-8] Sat Jun 13 10:51:08 2015
@@ -1,3 +1,13 @@
+gnome-terminal (3.14.1-1+deb8u1) UNRELEASED; urgency=medium
+
+ * Provide fallback for reading current directory if OSC 7 fails. In Debian
+ there is no mechanism (yet) to source scripts for non-login interactive
+ shells so we can't rely on /etc/profile.d/vte*.sh but instead fallback to
+ reading /proc to determine the working directory of the current tab.
+ (Closes: #706065)
+
+ -- Michael Biebl <biebl at debian.org> Sat, 13 Jun 2015 12:48:09 +0200
+
gnome-terminal (3.14.1-1) unstable; urgency=medium
* New upstream release.
Modified: desktop/jessie/gnome-terminal/debian/control
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/jessie/gnome-terminal/debian/control?rev=45062&op=diff
==============================================================================
--- desktop/jessie/gnome-terminal/debian/control [utf-8] (original)
+++ desktop/jessie/gnome-terminal/debian/control [utf-8] Sat Jun 13 10:51:08 2015
@@ -6,7 +6,7 @@
Section: gnome
Priority: optional
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers at lists.alioth.debian.org>
-Uploaders: Andreas Henriksson <andreas at fatal.se>, Emilio Pozuelo Monfort <pochu at debian.org>, Sjoerd Simons <sjoerd at debian.org>
+Uploaders: Andreas Henriksson <andreas at fatal.se>, Emilio Pozuelo Monfort <pochu at debian.org>, Michael Biebl <biebl at debian.org>, Sjoerd Simons <sjoerd at debian.org>
Standards-Version: 3.9.5
Build-Depends: cdbs (>= 0.4.41),
debhelper (>= 8),
Added: desktop/jessie/gnome-terminal/debian/patches/Provide-fallback-for-reading-current-directory-if-OS.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/jessie/gnome-terminal/debian/patches/Provide-fallback-for-reading-current-directory-if-OS.patch?rev=45062&op=file
==============================================================================
--- desktop/jessie/gnome-terminal/debian/patches/Provide-fallback-for-reading-current-directory-if-OS.patch (added)
+++ desktop/jessie/gnome-terminal/debian/patches/Provide-fallback-for-reading-current-directory-if-OS.patch [utf-8] Sat Jun 13 10:51:08 2015
@@ -0,0 +1,99 @@
+From: Martin Pitt <martinpitt at gnome.org>
+Subject: [PATCH] Provide fallback for reading current directory if OSC 7 fails
+
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697475
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712628
+---
+ src/terminal-screen.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+
+Index: gnome-terminal-3.14.1/src/terminal-screen.c
+===================================================================
+--- gnome-terminal-3.14.1.orig/src/terminal-screen.c 2015-06-13 12:46:52.883120561 +0200
++++ gnome-terminal-3.14.1/src/terminal-screen.c 2015-06-13 12:46:52.879120497 +0200
+@@ -216,6 +216,63 @@
+
+ G_DEFINE_TYPE (TerminalScreen, terminal_screen, VTE_TYPE_TERMINAL)
+
++static char *
++cwd_of_pid (int pid)
++{
++ static const char patterns[][18] = {
++ "/proc/%d/cwd", /* Linux */
++ "/proc/%d/path/cwd", /* Solaris >= 10 */
++ };
++ guint i;
++
++ if (pid == -1)
++ return NULL;
++
++ /* Try to get the working directory using various OS-specific mechanisms */
++ for (i = 0; i < G_N_ELEMENTS (patterns); ++i)
++ {
++ char cwd_file[64];
++ char buf[PATH_MAX + 1];
++ int len;
++
++ /* disable "format not a string literal" error, we know what we are doing */
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wformat-nonliteral"
++ g_snprintf (cwd_file, sizeof (cwd_file), patterns[i], pid);
++#pragma GCC diagnostic pop
++ len = readlink (cwd_file, buf, sizeof (buf) - 1);
++
++ if (len > 0 && buf[0] == '/')
++ return g_strndup (buf, len);
++
++ /* If that didn't do it, try this hack */
++ if (len <= 0)
++ {
++ char *cwd, *working_dir = NULL;
++
++ cwd = g_get_current_dir ();
++ if (cwd != NULL)
++ {
++ /* On Solaris, readlink returns an empty string, but the
++ * link can be used as a directory, including as a target
++ * of chdir().
++ */
++ if (chdir (cwd_file) == 0)
++ {
++ working_dir = g_get_current_dir ();
++ (void) chdir (cwd);
++ }
++ g_free (cwd);
++ }
++
++ if (working_dir)
++ return working_dir;
++ }
++ }
++
++ return NULL;
++}
++
+ static void
+ free_tag_data (TagData *tagdata)
+ {
+@@ -1534,12 +1591,21 @@
+ char *
+ terminal_screen_get_current_dir (TerminalScreen *screen)
+ {
++ TerminalScreenPrivate *priv = screen->priv;
+ const char *uri;
+
+ uri = vte_terminal_get_current_directory_uri (VTE_TERMINAL (screen));
+ if (uri != NULL)
+ return g_filename_from_uri (uri, NULL, NULL);
+
++ if (priv->child_pid > 0) {
++ char *cwd = cwd_of_pid (priv->child_pid);
++ if (cwd != NULL) {
++ g_debug ("terminal_screen_get_current_dir: VTE current dir n/a, reading from /proc: %s", cwd);
++ return cwd;
++ }
++ }
++
+ if (screen->priv->initial_working_directory)
+ return g_strdup (screen->priv->initial_working_directory);
+
Modified: desktop/jessie/gnome-terminal/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/jessie/gnome-terminal/debian/patches/series?rev=45062&op=diff
==============================================================================
--- desktop/jessie/gnome-terminal/debian/patches/series [utf-8] (original)
+++ desktop/jessie/gnome-terminal/debian/patches/series [utf-8] Sat Jun 13 10:51:08 2015
@@ -2,3 +2,4 @@
01_onlyshowin.patch
10_kfreebsd-f_dupfd_cloexec.patch
Don-t-allow-the-theme-to-set-black-on-black.patch
+Provide-fallback-for-reading-current-directory-if-OS.patch
More information about the pkg-gnome-commits
mailing list