Bug 268322

Summary: Konsole current working directory when opening new tabs or windows is /usr/share/man if reading a man page in previous window
Product: [Applications] konsole Reporter: dennis.aldana
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED DOWNSTREAM    
Severity: minor CC: franke.daniel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description dennis.aldana 2011-03-12 22:44:37 UTC
Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

While reading a man page in a Konsole window, if a new tab or window is opened through  any means, current working directory is /usr/share/man

Reproducible: Always

Steps to Reproduce:
Open Konsole
Type: "man cat" (or man anything)
Go to File > New Window (or new Tab, or double click the tab bar, or even left click and "open file manager")


Actual Results:  
Current working directory is /usr/share/man

Expected Results:  
Current working directory should be the directory been browsed in Konsole before reading the man page, or at least home directory if that is not known. 

OS: Linux (i686) release 2.6.37-ARCH
Compiler: gcc
Comment 1 Kurt Hindenburg 2011-03-19 16:01:17 UTC
Konsole get the current working directory from the current session to copy to the new session.  'man' sets the cwd to /usr/share/man

Example:

4774 pts/6    S+     0:00 man man

/proc/4774/cwd -> /usr/share/man/
Comment 2 dennis.aldana 2011-03-19 23:52:41 UTC
yeah, it may be the normal behavior, it certainly is not what I was specting so I thought in reporting, but it's so trivial you may close this bug at your discretion. I think man shouldn't change cwd thou. 

(In reply to comment #1)
> Konsole get the current working directory from the current session to copy to
> the new session.  'man' sets the cwd to /usr/share/man
> 
> Example:
> 
> 4774 pts/6    S+     0:00 man man
> 
> /proc/4774/cwd -> /usr/share/man/
Comment 3 Kurt Hindenburg 2011-03-20 16:51:07 UTC
I agree man should not be setting the cwd.

Anyway I don't see how Konsole could get around this as-is.
Comment 4 Daniel Franke 2011-04-13 11:34:11 UTC
*** Bug 270620 has been marked as a duplicate of this bug. ***
Comment 5 Daniel Franke 2011-04-13 11:37:09 UTC
See the dupe for in #4 another example, 'find' in that case.

Personally I don't think this is an issue in any application that changes the current working directory -- have fun trying to weed them all out -- but something that should be fixed in konsole instead.