Commit ebcab3c3 authored by Jekyll Wu's avatar Jekyll Wu

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
parent 3ceb3246
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment