<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/106177/">http://git.reviewboard.kde.org/r/106177/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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).
</pre>
 <br />







<p>- Jekyll</p>


<br />
<p>On August 25th, 2012, 12:37 p.m., Kurt Hindenburg wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Konsole.</div>
<div>By Kurt Hindenburg.</div>


<p style="color: grey;"><i>Updated Aug. 25, 2012, 12:37 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">tested Konsole - not the kpart</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=302903">302903</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/Session.cpp <span style="color: grey">(778cbbc)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/106177/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>