[Konsole-devel] Review Request: When no working directory is specified, use the $PWD of konsole itself instead of $HOME

Jekyll Wu adaptee at gmail.com
Mon Apr 9 10:25:25 UTC 2012


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

(Updated April 9, 2012, 10:25 a.m.)


Review request for Konsole.


Changes
-------

Improve compatibility with old behavior:

Only use $PWD as fallback value for the first session; For all following created session, $HOME is used as fallback value as before.


Description
-------

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.


This addresses bug 187754.
    http://bugs.kde.org/show_bug.cgi?id=187754


Diffs (updated)
-----

  src/Session.cpp 3eb1a87 

Diff: http://git.reviewboard.kde.org/r/104518/diff/


Testing
-------


Thanks,

Jekyll Wu

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


More information about the konsole-devel mailing list