Add openTeletype option for use without shell
An external developer might want to open a teletype in a Session
or a Part
without an additional shell interfering / in background (e.g. pty to /bin/vi).
Therefore, a new optional argument is introduced to run a pty
process standalone. Consistency is held with legacy method calls.
Beside adding the new optional argument for openTeletype()
, the change that has to be made to actually stop the shell from running is in Session.cpp. There, the Session
constructor calls openTeletype()
to create the _shellProcess
, but more important that method adds a callback from end of initialization of _emulation
to Konsole::Session::run
. Given the case that teletype needs to be used without the shell, this is what needs to be prevented. However, using Konsole
as a Part
, the external developer has no direct control over the constructor of a Session
- as such the mentioned callback needs to be removed if the user wishes not to run the Session
.
This is essential for running an interactive application like /bin/vi correctly (old: both, sh and vi interpret inputs and write ouput, simultaneously) via teletype in a Konsole
Part
. One may compare the old and the new behaviour of PartTest.cpp, where there is no shell prompt cluttering the output anymore. The old behaviour is kept as default.