[Konsole-devel] Review Request: For a console program, don't start in ~/Documents

Jekyll Wu adaptee at gmail.com
Sun Aug 26 06:27:01 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106177/#review18011
-----------------------------------------------------------


Yes, the result is annoying and I agree nobody want his/her shell to start in ~/Documents by default. 

But I don't see anything wrong on the konsole side. The code just tries to respect (when it is appropriate) the working directory inherited from the parent process that starts konsole. That process could be another bash/zsh running in a whatever terminal emulator, could be a common part behind the kmenu/krunner/khotkey interfaces. Whatever the parent process is, konsole behave in a consistent way: use the working directory inherited from the parent process as statring point when there is no starting point explicitly specified in the default profile.

So case #1: I'm running bash in a xterm. I'm in ~/Documents in the bash now. I want to start konsole so I type "konsole" and press enter.  Konsole shows up and the shell running in konsole starts in ~/Documents because that is the working directory inherited from parent process(that bash running in the xterm). And that is exactly how every emulator I have tried has been doing, except the konsole before 2.9 because it didn't care about that inherited working directory at all.

So case #2: I want to start konsole so I type "konsole" into krunner and press enter. Konsole shows up and the shell running within konsole starts in "~/Documents". That happens due to the same logic as in case #1. 

So by comparing case #1 and #2, konsole does its work consistently and does not do any extra strange work in case #2 than in case #1. The strange part is the inherited working process in case #2: why does the common part behind kmenu/krunner/khotkey use "~/Documents" as working directory by default when that folder exists? That is something I don't understand, but it is clearly not konsole's job or fault.



And now comes to this patch. It tries to workaround the problem of strange working directory in other components. It does eliminate bug 302903, but I don't like that solution/workaround, because

  * it makes konsole doing unnecessary work

  * it makes the code strange and hard to understand for future contributors. I bet he/she wouldn't understand why this piece of code is needed here unless it is intensively commented or he/she spends time digging the git log and bugzilla for the reason.

  * it causes inconsistency. The patch means: 
     
     1. If I'm in /var in a shell, typing "konsole" and pressing enter will bring up konsole and the shell in konsole will starts in /var. 
      
     2. If I'm in ~/Documents in a shell, typing "konsole" and pressing enter will bring up konsole and the shell in konsole will starts in ~. 

     So the patch introduces inconsistency, while the existing code does its work quite consistently.



Finally, get back to the bug report. Now matter how much I think it is not konsole's problem, if users think it's konsole's problem, then it is and should be fixed. Clearly, we can't make everyone (case #1 and case #2) happy before bug 183534 is fixed. Now that there is a bug report complaining of case #2 but no bug report requesting case #1 as enhancement, I think the better fix for now is :

    1. revert commit ebcab3c307f83ddf42a9096b8a76a5389ce52f3d to fix bug 302903. Of course, that means konsole loose the support for case #1.
    2. open another report requesting konsole to support case #1,  and marks bug 183534 as its blocker
    3. wait for bug 183534 to be fixed 

But frankly, I don't like that better fix, either. It is just a different kind of workaround. The real fix should go to bug 183534, because it clearly influences many many more applications (hint: xterm, gnome-terminal, etc).


- Jekyll Wu


On Aug. 25, 2012, 12:37 p.m., Kurt Hindenburg wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106177/
> -----------------------------------------------------------
> 
> (Updated Aug. 25, 2012, 12:37 p.m.)
> 
> 
> Review request for Konsole.
> 
> 
> Description
> -------
> 
> In 4.9 and master, running Konsole from the menu or Run command will start Konsole in the ~/Documents folder.  For a console program this is annoying and I don't see any reason why anyone would want that.
> 
> 
> This addresses bug 302903.
>     http://bugs.kde.org/show_bug.cgi?id=302903
> 
> 
> Diffs
> -----
> 
>   src/Session.cpp 778cbbc 
> 
> Diff: http://git.reviewboard.kde.org/r/106177/diff/
> 
> 
> Testing
> -------
> 
> tested Konsole - not the kpart
> 
> 
> Thanks,
> 
> Kurt Hindenburg
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20120826/f02ba182/attachment.html>


More information about the konsole-devel mailing list