Bug 242583 - Session restore: symlinks get resolved
Summary: Session restore: symlinks get resolved
Status: RESOLVED LATER
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.4.3
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 12:59 UTC by Per (phobie)
Modified: 2011-08-04 17:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.