Bug 242583

Summary: Session restore: symlinks get resolved
Product: [Applications] konsole Reporter: Per (phobie) <kdebugs.phobie>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED LATER    
Severity: normal CC: adaptee
Priority: NOR    
Version: 2.4.3   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Per (phobie) 2010-06-23 12:59:08 UTC
Version:           2.4.3 (using KDE 4.4.4) 
OS:                Linux

On session restore konsole reopens all tabs and tries to set the correct directories. Sadly all symlinks in paths get resolved to its real path.

Reproducible: Always

Steps to Reproduce:
Open Konsole
$ mkdir ~/links
$ ln -s /usr/local/bin ~/links/local-bins
$ cd ~/links/local-bins
Current dir "~/links/local-bins/"
Relog...
Current dir "/usr/local/bin/"



Expected Results:  
Keep all dirs as they where shown before the logout.

OS: Linux (x86_64) release 2.6.34-0.px.1-amd64
Compiler: cc
Comment 1 Kurt Hindenburg 2010-06-30 17:25:07 UTC
Yes, apparently when WorkDir gets saved in session file it gets expanded.
Comment 2 Kurt Hindenburg 2010-06-30 17:39:17 UTC
ProcessInfo:


        if ( readable && info.isSymLink() )
        {
            setCurrentDir( info.symLinkTarget() );
            return true;
        }

I'm not sure if there is a reason to return the target of a link.
Comment 3 Kurt Hindenburg 2010-06-30 18:02:05 UTC
Konsole gets the current dir via /proc/PID/cwd

example ~/s linked to /usr/share

kdetrunk@jupiterkdetrunk:~/s$ pwd
/home/kdetrunk/s

lrwxrwxrwx 1 kdetrunk kdetrunk 0 Jun 30 11:57 /proc/28764/cwd -> /usr/share/

So when Konsole gets the target of /proc/PID/cwd it bypasses the link.
Comment 4 Jekyll Wu 2011-08-04 17:50:14 UTC
Generally, it is impossible to implement that. konsole only knows about the symlink-resolved form of PWD. Only shell knows about the symlink stuff.

See comment #1 of bug #244449 for details.