Fix checking of foreground process
Review Request #128789 - Created Aug. 28, 2016 and submitted
|Martin Tobias Holmedahl Sandsmark|
The old method of checking it has unnecessary overhead (doing a full process info update), and wasn't very reliable.
Instead just get the original shell PID from QProcess (via KProcess), and the foreground process from the PTY.
It fixes https://bugs.kde.org/show_bug.cgi?id=367746 for me, also added debug output to print the shell PID and the current process PID to verify that it acted correctly when doing stuff.