Bug 304816

Summary: Dolphin should warn the user before closing if there's a process (program, script) running in built-in shell
Product: [Applications] dolphin Reporter: titombitel
Component: panels: terminalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: nate, serhiy.int
Priority: NOR Keywords: usability
Version: 2.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=482838
Latest Commit: Version Fixed In: 19.04.0
Sentry Crash Report:

Description titombitel 2012-08-08 19:29:04 UTC
Some users (like me) often run their programs from built-in shell to see stderr error messages. Unfortunately, the program run from shell is a child of konsole, that is a child of dolphin. Closing Dolphin kills the program.
This affects KWrite but for some reason it doesn't touch Kaffeine. So for some reason not even all Qt4 apps are affected.

Simple solution:
Dolphin should at least warn the user that closing it will cause his program to get killed.

Solution from my dreams:
Konsole with the program run from it should still be running as children of kdeinit4, with no dolphin above. Dolphin should close normally. Konsole should get a new window. I have nice dreams, huh? :D

Reproducible: Always

Steps to Reproduce:
1. Open Dolphin
2. Summon the shell (F4)
3. Run something like glxgears
4. Close Dolphin.
Actual Results:  
The program gets killed.

Expected Results:  
It should be still running.

Configuration shouldn't matter.
Comment 1 Frank Reininghaus 2012-08-09 10:27:34 UTC
Thanks for the report!

I agree that some kind of warning might be nice, but please note that not even Konsole warns when closing it and indirectly killing its child processes. Moreover, I think that this is far from easy to implement. I consider this a feature request and not a bug.
Comment 2 titombitel 2012-08-09 19:29:55 UTC
You're completely right, thanks for fast response.
But users are not used to get their program killed when they close file manager. That's kind of trap.

Another idea: Warn the user when he opens (not closes) built-in shell that closing Dolphin will cause the shell job to be terminated and include "Don't show it again" checkbox. That would be rather easy.

However, I didn't emphasize it: some programs like Kaffeine don't suffer from this "trap".
Comment 3 Frank Reininghaus 2012-08-09 21:10:51 UTC
(In reply to comment #2)
> You're completely right, thanks for fast response.
> But users are not used to get their program killed when they close file
> manager. That's kind of trap.
> 
> Another idea: Warn the user when he opens (not closes) built-in shell that
> closing Dolphin will cause the shell job to be terminated and include "Don't
> show it again" checkbox. That would be rather easy.

Yes, but it would annoy many users. Of course, the unexpected closing of apps is also an annoyance, but I think we did not get any bug reports about that before, and the issue has been around for many years. Therefore, I think that the benefit of having such a warning would not outweigh the negative effects of the annoying warning. But I'm not 100% sure, maybe I'm wrong after all.

> However, I didn't emphasize it: some programs like Kaffeine don't suffer
> from this "trap".

It could be that the Kaffeine process which is run in the shell starts the process which actually runs the app indirectly, such that this one is not affected by killing the terminal.
Comment 4 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:21:28 UTC
Resetting assignee to default as per bug #305719
Comment 5 Nate Graham 2018-03-15 03:12:19 UTC
There's a patch for this: https://phabricator.kde.org/D10960
Comment 6 Nate Graham 2019-01-19 15:15:26 UTC
Git commit 2100a7a5c85931d46b72d391faa3d136d4401010 by Nate Graham.
Committed on 19/01/2019 at 15:15.
Pushed by ngraham into branch 'master'.

Ask for confirmation when Closing Dolphin windows with a terminal panel running a program

Summary:
Ask for confirmation when Closing Dolphin windows with a terminal panel running a program.
FIXED-IN: 19.04.0

Test Plan:
# Open terminal panel
# Run `watch ls`
# Close Dolphin
# Observe confirmation
# Disable confirmation
# Repeat, observe no confirmation
# Enable confirmation in the settings
# Repeat, observe a confirmation

Reviewers: #dolphin, markg, elvisangelaccio, rominf

Reviewed By: #dolphin, elvisangelaccio

Subscribers: kfm-devel, elvisangelaccio, markg, ngraham, rkflx, broulik, #dolphin

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D10960

M  +53   -1    src/dolphinmainwindow.cpp
M  +13   -3    src/panels/terminal/terminalpanel.cpp
M  +3    -1    src/panels/terminal/terminalpanel.h
M  +4    -0    src/settings/dolphin_generalsettings.kcfg
M  +28   -0    src/settings/general/confirmationssettingspage.cpp
M  +5    -0    src/settings/general/confirmationssettingspage.h

https://commits.kde.org/dolphin/2100a7a5c85931d46b72d391faa3d136d4401010