Version: 2.4.5 (using KDE 4.4.5)
In opposite to all other terminal emulators I tested (gnome-terminal, xterm, xfce4-terminal, xvt, mrxvt) konsole is the only one automatically running in background. This should clearly be not the case and for any application starting in foreground shells have possibilities to move a process to background but its not working if the process is automatically launched in background.
This mainly theoretical bug becomes problematic for example if you want to start only a konsole-Window as custom command within NX-compression (NeatX). NeatX is starting commands with "bash -c <command>", if the process automatically starts in background, bash returns immediately 0 and the NX connection is closed again. I would imagine this issue is easy to fix but also necessary as there should be no reason why konsole differs in functionality from all other terminal emulators. Thanks.
Steps to Reproduce:
Start konsole from any terminal emulator and hit <Enter> in the parent terminal emulator to proof it is started as background process.
In case of NX (NeatX) usage: Start NX session with custom command "konsole".
In case of NX (NeatX) usage: konsole opens up and immediately closes again.
In case of NX (NeatX) usage: konsole should stay opened.
konsole --version output:
KDE: 4.4.5 (KDE 4.4.5)
uname -a output:
Linux ikkatrinsrv1 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC 2010 x86_64 GNU/Linux
Still no option to force foreground mode??? Unbelievable.
konsole -e "ssh somewhere dosomething"
are impossible because the echo command is executed immediately and there is no way to wait for konsole termination.
Roberto - You can use the --nofork option
Robert - Thank you. The --nofork option actually works. But it is not documented; not in --help at least....
Maybe the bug can be closed after just documenting the --nofork option.
--nofork shows up under --help-kde
Is there any understandable reason to not use the --nofork option as default? This could help a lot of programs and scripts waiting for the process termination.
However starting a process in background is such a simple and elementary task that even a Linux beginner is capable to fork e.g. konsole if he likes to. Finding the --nofork option when using --help-kde is not very intuitive.
I have to admit that I - while being using KDE every day since 1998 - completely missed the --nofork option hidden in --help-kde. So it is indeed not intuitive.
I agree with the proposal to have --nofork as the default.
> Is there any understandable reason to not use the --nofork option as default
Yes. Konsole uses a single process for all terminal windows by default to facilitate improved startup time and resource sharing amongst windows and also enables some features like dragging and dropping tabs between windows.
We have discussed this behaviour also here:
where it also effects the -e option.
I don't care what the default behaviour is, as long as it is well documented. That means, not only on the command line help, but also in the KDE GUI Help it should clearly be mention. Please see the bug report I mentioned, to know where I would like to see a better documentation. It should be stated for each option in more detail how the forking effects that option.
It is not very convenient, if you have to read several documentations, before you can savely use an option in konsole or any other KDE program.
IMHO, --nofork should be the default behaviour *when* konsole is invoked from terminal(stdin is a tty).
#217357 and #173697 are two good examples. If --nofork is the default behavior when invoked from terminal, those two problems simply do not exist.
Git commit 43ff8c48a7a0fd0086845f6aab8ecace51448732 by Kurt Hindenburg.
Committed on 31/07/2011 at 21:11.
Pushed by hindenburg into branch 'master'.
Add --nofork to the --help output.
--nofork is under --help-kde which is often overlooked by users.
Placing a comment under --help should cause less problems for users.
M +1 -0 src/main.cpp
(In reply to comment #9)
> IMHO, --nofork should be the default behaviour *when* konsole is invoked from terminal(stdin is a tty).
Another (less convincing) example: '--geometry' is currently useless unless '--nofork' is also used, see comment #23 of bug #155603.
Although I agree #165355 on kdelibs is the root cause for the broken '--geometry', but if '--nofork' is the default behavior *when* invoked from terminal, konsole users will enjoy easier life.
Another problem caused by this foreground feature is users have difficuty setting some terminal editor(vim/nano/jed) as the external editor used by kmail. See comment #4 and #6 of bug #170867 for more info.