Commit e455db64 authored by Robert Knight's avatar Robert Knight
Browse files

Start a new process rather than re-using an existing one when Konsole is started

from a terminal.  This is useful because:

1)  The environment from the terminal propagates into the new process
(including changes to DISPLAY)
2)  Konsole/KDE 4 can be used for developing Konsole/KDE 4.

Squashed commit of the following:

commit a0bfaa3612b15937a773f3d7a3cfdf34b4fc123f
Author: Robert Knight <>
Date:   Thu Apr 10 15:38:58 2008 +0100

    Adapt to new KUniqueApplication::StartFlag names.

commit 25a7f64b9d9a9bc6e000bdd43a8f69652645542b
Author: Robert Knight <>
Date:   Sun Mar 23 04:42:01 2008 +0000

    Force creation of a new Konsole process when Konsole is started from a terminal.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=795982
parent f04dccea
......@@ -21,6 +21,9 @@
#include "Application.h"
#include <KDebug>
// Unix
#include <unistd.h>
// X11
#ifdef Q_WS_X11
#include <X11/Xlib.h>
......@@ -71,9 +74,17 @@ extern "C" int KDE_EXPORT kdemain(int argc,char** argv)
// when starting Konsole from a terminal, a new process must be used
// so that the current environment is propagated into the shells of the new
// Konsole and any debug output or warnings from Konsole are written to
// the current terminal
KUniqueApplication::StartFlags startFlags;
if (isatty(1))
startFlags = KUniqueApplication::NonUniqueInstance;
// create a new application instance if there are no running Konsole instances,
// otherwise inform the existing Konsole instance and exit
if ( !KUniqueApplication::start() )
if ( !KUniqueApplication::start(startFlags) )
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