[Konsole-devel] Environment of non-forked konsole-sessions

Thomas Bach bach at elefantstudios.ch
Thu Jan 12 14:28:50 UTC 2012


Hello

We're currently upgrading our linux workstations from centos 5 to centos 6.

In centos 6 I experience some strange behaviour of konsole compared to the
one in centos 5

Centos 6 version informations
$ konsole -v
Qt: 4.6.2
KDE: 4.3.4 (KDE 4.3.4)
Konsole: 2.3.3

Centos 5 version informations
$ konsole -v
Qt: 3.3.6
KDE: 3.5.4-25.el5.centos.1 Red Hat
Konsole: 1.6.4

Following a simple reproduction of my problem with centos 6 (KDE 4.3.4):

Case A:
KDE-App-Launcher
     -> starts simple PyQt-App (see below)
           start "konsole -e --noclose /bin/env" with specific environment
           start "konsole -e --noclose /bin/env" with changed env variable

then the changed env-variable will not be transmitted to the second
konsole-call
On the other hand:

Case B:
start konsole
     -> start simple PyQt-App (see below)
           start "konsole -e --noclose /bin/env" with specific environment
           start "konsole -e --noclose /bin/env" with changed env variable

then everything works as I expected

I think this might be due to the isatty-call of the following function in
the main.cpp:
bool shouldUseNewProcess()
respectively
bool forceNewProcess() in older versions

in case A there is only one konsole-process
in case B there are two different konsole-processes

Is there a way to tell konsole to always start a new process (and
environment) for every call. What we need is the environment-behaviour as
in case B without the need of the initial konsole-call.

I don't know weather this is as intended or if this is a bug. Could you
explain me, what the behaviour of case A is as described?

Many thanks in advance and kind regards,
thomas

--
simple qt-app:


from PyQt4.QtGui import QDialog, QApplication, QPushButton
from PyQt4 import QtCore
import sys

from subprocess import Popen, PIPE
import os

class TestDialog(QDialog):
    def __init__(self, parent = None):
        super(TestDialog, self).__init__(parent)
        self.setupGui()
        self.counter = 1000

    def setupGui(self):
        button = QPushButton("test", self)
        self.connect(button, QtCore.SIGNAL("clicked()"), self.buttonClicked)

    def buttonClicked(self):
        myenv = os.environ
        self.counter = self.counter * 2
        myenv["ZZZZZZZZZZZZ"] = "counter: % 6d" % self.counter
        p = Popen("/usr/bin/konsole --noclose -e /bin/env", env=myenv,
shell=True)

def main():
    app = QApplication(sys.argv)
    myapp = TestDialog()
    myapp.show()
    sys.exit(app.exec_())

if __name__ == "__main__":
    main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20120112/61418664/attachment.html>


More information about the konsole-devel mailing list