<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/104518/">http://git.reviewboard.kde.org/r/104518/</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;">This review has been submitted with commit ebcab3c307f83ddf42a9096b8a76a5389ce52f3d by Jekyll Wu to branch master.</pre>
 <br />







<p>- Commit</p>


<br />
<p>On April 9th, 2012, 10:25 a.m., Jekyll Wu 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 Jekyll Wu.</div>


<p style="color: grey;"><i>Updated April 9, 2012, 10:25 a.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;">Before applying this patch: the order of deciding the working directory is :

    --workdir
    profile option
    $HOME

After applying this patch: the order of deciding the working directory is :
    --workdir
    profile option
    $PWD of Konsole itself

The rational : 

Most of popular file managers provide the feature of "open terminal here". Examples are dolphin(KDE), nautilus(GNOME), thunar(XFCE), pcmanfm(LXDE). They all allow users to choose their favorite terminal emulator instead of the default one. However, the existing behavior of konsole makes it hard or impossible to be used with those file managers(except dolphin)
Because those file manager expect the terminal emulator to set the working directory according to the $PWD, while konsole simply does not.

The way konsole working together with dolphin is through konsolehere.deskop, which contains "Exec=konsole --workdir %f". So it is the responsibility of file manager to explicitly pass the working directory as argument to Konsole. The unfortunate fact is most file manager expect terminal emulator to get and set the working directory implicitly according to $PWD. For example, pcmanfm only care about the command name of emulator, never considering and providing the needed argument.

It is not only GUI file managers. Ranger, a very useful ncurses file manager, support the ":terminal" command to open a new terminal(looking up the $TERMCMD environment). Ranger also expects the terminal to use $PWD, which makes Konsole fail here.

It is not technically wrong for Konsole to use $HOME instead of $PWD as the fallback value. However, using $PWD seems to be the well accepted convention, and breaking away from that assumption brings some cooperation problem.


The pros and cons of this change:

  * pros: now Konsole works more like most emulators. No need to use "konsole --wordir ." to start konsole from  a existing terminal. 

  * cons: although the patch is simple, the behavior change is fundamental. Might introduce some compatibility issues for users who have get accustomed to or even depend upon the old behavior.
</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=187754">187754</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">(3eb1a87)</span></li>

</ul>

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




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








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