Every now and then the PtyTest fails. A rerun typically fixes it.
Add errno output on tcgetpgrp failure. Close pty after test.
FAIL! : Konsole::PtyTest::testRunProgram() Compared values are not the same
Actual (pty.foregroundProcessGroup()): 0
Expected (pty.processId()) : 3239
we need this to happen before KSandbox::makeHostContext because the
first argument is not necessarily the shell command anymore afterwards,
confusing the legacy logic inside Pty. simply move the manipulation into
Session.cpp
this should make the flatpak build work properly
kpty code is (as of now) unix-only, so konsole as a whole cannot
possibly work on windows (without a thick emulation layer). therefore,
remove the pointless #ifdefs that only reduce the code's legibility.
the new session close behavior is again the old
- first send SIGHUP and wait one second if that works
- then hard kill
before we tried to send an EOF character
this needed workaround to not kill "non shell" programs
unexpected and doesn't work e.g. if
- you have some not finished command input in your shell
- on e.g. FreeBSD in general
When closing the session with some background process still running:
- using Ctrl+D (which sends EOF) will leave that background process running
(which is the expected behaviour with e.g. BASH:
https://lists.gnu.org/archive/html/bug-bash/2009-03/msg00091.html)
- using e.g. the close button on the titlebar will close the session and kill any background processes
You can also use 'somecommand & disown', if you want to ensure background processes
aren't killed when you close a konsole window.
BUG: 401898
CCBUG: 185140
According to the bash maintainer sending EOF is the appropriate way of
telling e. g. bash to quit:
http://permalink.gmane.org/gmane.comp.shells.bash.bugs/12602
I wasn't able to get KPtyProcess to send that in a nice way (calling
setStandardInputFile(QProcess::nullDevice(), for example), so we fetch
the EOF character manually with tcgetattr and send that.
BUG: 185140
REVIEW: 128416
The old code used Latin1() to check program names and also used
QFile::encodeName().
Thanks to Eugene Shalygin for report and research.
Example:
cp `which vi` ./编辑器
konsole -e ./编辑器
BUG: 297529
FIXED-IN: 2.8.3