summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJekyll Wu <adaptee@gmail.com>2012-04-09 05:53:00 (GMT)
committerJekyll Wu <adaptee@gmail.com>2012-04-10 16:36:39 (GMT)
commitebcab3c307f83ddf42a9096b8a76a5389ce52f3d (patch)
treea6222d0306105e986e76d6d93da669198719dc05
parent3ceb32461c107dd3feb315a4a4022acad72612ec (diff)
Use $PWD as the fallback value for setting initial working directory
This means running "konsole" literally in a terminal will open a konsole which starts in the same directory as the current terminal. "konsole --workdir ." is no more needed. This makes Konsole behave like most other emulators. Another befinit is it is now easier to use konsole for the "Open terminal here" feature provided in file managers other than dolphin. Note: due to the "single process" model of konsole, konsole sometimes does not open the expected the direcotory when used by this "Open terminal here" feature. REVIEW: 104518 BUG: 187754 FIXED-IN: 4.9.0
-rw-r--r--src/Session.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Session.cpp b/src/Session.cpp
index d375606..038a072 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -452,10 +452,13 @@ void Session::run()
QStringList() << exec :
_arguments;
- if (!_initialWorkingDir.isEmpty())
+ if (!_initialWorkingDir.isEmpty()) {
_shellProcess->setInitialWorkingDirectory(_initialWorkingDir);
- else
- _shellProcess->setInitialWorkingDirectory(QDir::homePath());
+ } else {
+ _shellProcess->setInitialWorkingDirectory(QDir::currentPath());
+ // for all following invocation, use $HOME as fallback
+ QDir::setCurrent(QDir::homePath());
+ }
_shellProcess->setFlowControlEnabled(_flowControlEnabled);
_shellProcess->setEraseChar(_emulation->eraseChar());