[konsole] [Bug 458591] New: OSC 7 stopped working to preserve path when creating a new tab
Gabriel Marcano
bugzilla_noreply at kde.org
Thu Sep 1 07:05:56 BST 2022
https://bugs.kde.org/show_bug.cgi?id=458591
Bug ID: 458591
Summary: OSC 7 stopped working to preserve path when creating a
new tab
Product: konsole
Version: 22.08.0
Platform: Gentoo Packages
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: emulation
Assignee: konsole-devel at kde.org
Reporter: gabemarcano at yahoo.com
Target Milestone: ---
Created attachment 151752
--> https://bugs.kde.org/attachment.cgi?id=151752&action=edit
List of packages updated today
SUMMARY
This may not be a Konsole problem, but I have not been able to track down where
the problem originates (it's either in Qt or in KDE dependencies of Konsole or
Konsole itself).
I have the following on my .bashrc:
_osc7 () {
printf "\033]7;file://%s%s\033\\" "$HOSTNAME" $(pwd)
}
PROMPT_COMMAND=_osc7
With this, I was able to create new tabs when in symlinked folders, and the new
tab would preserve the path taken to get there in the path shown on bash. As an
example, /tmp/foo is an folder, /tmp/bar is a symlink to /tmp/foo:
/tmp/foo
/tmp/bar -> /tmp/foo
If I cd'd to /tmp/bar and then launched a new tab (Ctrl-Shift-T), the current
working directory on the new tab would show as /tmp/bar instead of /tmp/foo.
This stopped working with the latest update. Now, if I `cd /tmp/bar` and launch
a new tab, the new tab shows the current working directory as /tmp/foo.
STEPS TO REPRODUCE
1. mkdir /tmp/foo
2. ln -s /tmp/foo /tmp/bar
3. cd /tmp/bar
4. printf "\033]7;file://%s%s\033\\" "$HOSTNAME" $(pwd)
5. launch a new tab in Konsole
6. in the new tab, run pwd
OBSERVED RESULT
$ pwd
/tmp/foo
EXPECTED RESULT
$ pwd
/tmp/bar
SOFTWARE/OS VERSIONS
Linux: Gentoo Linux
(available in About System)
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
ADDITIONAL INFORMATION
I spent a couple of hours tracing through Konsole, qtcore, and a couple of KDE
framework projects, trying to figure out the culprit. I've ruled out the shell
as a problem, as the issue appears whether I use /bin/bash or /bin/sh as the
shell for the session.
I tried rolling back to an older Konsole release from 2021, and the problem
persists... which hints that the problem might be deeper than Konsole. I don't
have the knowledge necessary to identify the actual source of the problem,
though, so I'm choosing Konsole as the source until something more specific
can be found.
As far as I can tell through debugging, the QProcessPrivate::execChild call
deep in qtcore done by the forked process that spawns the new tab does receive
the right directory to change into. As Konsole spawns a bunch of other
processes around this time, and they all time out if I take too long stepping
through things, I was not able to debug any deeper to see what, if anything,
changed the working directory.
>From what I can tell, though, there doesn't appear to be anything in Konsole to
pass the OSC 7 from one tab to the new one. Not sure if that information has a
different way to make it from one tab to another.
Let me know if you need anything specific, or if there are specific things I
can try to help debug this issue. I can build and debug Konsole, as well as any
of its dependencies. I can reproduce this on both of my Gentoo systems
currently (a desktop and a laptop), and I did confirm this morning that before
the updates, OSC 7 was working fine on my desktop.
I'm attaching the full list of KDE and QT applications/libraries that I updated
today on my desktop, in case it helps. There are a lot of applications there,
though.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list