Bug 134581 - Closing tab started with '-e cmd' doesn't show confirmination popup
Summary: Closing tab started with '-e cmd' doesn't show confirmination popup
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-24 11:54 UTC by Maciej Pilichowski
Modified: 2021-02-09 19:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2006-09-24 11:54:55 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs

I run konsole this way
konsole --noclose -e my_script

I know konsole is full aware where the process is finished because it changes the window titles. But there is no warning when I try to close window when the process is running.

It would be much safer for me, if I could set (this future) option "confirm quit..." on.
Comment 1 Robert Knight 2006-09-24 13:05:56 UTC
> I know konsole is full aware where the process is finished 
> because it changes the window titles. But there is no warning 
> when I try to close window when the process is running. 

No, Konsole is not aware of whether processes are running in the shells or not.  The program running in the shell is able to set the Konsole title by putting certain sequences of characters in the output stream.

Unfortunately the only way I know of reliably finding out whether there is a program running in the shell is to scan the contents of the /proc filesystem and looking for processes which list the shell process as their parent.  This is a little slow, but not impossible.

Konsole could probably make an intelligent guess as to whether or not a program is running by looking at the amount of time since output from the program running in the shell was received.  
Comment 2 Maciej Pilichowski 2006-09-24 13:37:33 UTC
> No, Konsole is not aware of whether processes are running in the shells or
> not.  

I am not talking about the shell, but the process launched. For check this, I just wrote the tiny program in C++ which just sits and waits for the input. When I terminate it, Konsole displays "Finished".

So it is aware!

> The program running in the shell is able to set the Konsole title by putting
> certain sequences of characters in the output stream. 

Does this code set anything?

int main()
{
  while (true)
  {
    string s;
    cin >> s;
  }
  return 0;
}
 
> Konsole could probably make an intelligent guess as to whether or not a
> program is running by looking at the amount of time since output from the
> program running in the shell was received.

Konsole works just fine right now. I am asking for extra feature related to displaying this "finished" info -- before displaying it, please, confirm quit. I am not talking about additional recognizing finishing process -- _IT IS ALREADY DONE_.
Comment 3 Lars Doelle 2006-09-25 01:56:02 UTC
> > Konsole could probably make an intelligent guess as to whether or not a
> > program is running by looking at the amount of time since output from the
> > program running in the shell was received.


Often, its only the user out for lunch, but not the command terminated.
Typical perhaps, distribution updating, stopping to ask a question.

> Konsole works just fine right now. I am asking for extra feature related to
> displaying this "finished" info -- before displaying it, please, confirm quit.


You mean "confirm quit" for a "konsole -noclose <Command>" still running the
Command. What would you use it for?
Comment 4 Maciej Pilichowski 2006-09-25 11:54:16 UTC
Lars,

> You mean "confirm quit" for a "konsole -noclose <Command>" still running the 
> Command. 

Yes. If the process is finished -- do not ask user for confirmation (no change here; konsole works this way right now).

Of course it should be an option, nothing hard-coded.

> What would you use it for?

Safety reason. When you close konsole you kill the process which can lead to data leak. And since there is no confirmation from konsole it is too easy to do it (even if launched process itself has some kind of confirm-quit protection).
Comment 5 Robert Knight 2006-09-28 12:43:05 UTC
> I am not talking about the shell, but the process launched.

Yes sorry, I didn't read the original report closely enough.  This should be easy to add.


> _IT IS ALREADY DONE_. 

Please don't shout in bug reports, you already made your point.   
Comment 6 Maciej Pilichowski 2006-09-28 13:29:07 UTC
Robert, you are right, sorry for that.
Comment 7 FiNeX 2008-05-02 11:21:10 UTC
This feature is partially implemented. Look at bug #157015 (comment #25 and #26).
Comment 8 Kurt Hindenburg 2021-02-09 19:43:27 UTC
Git commit 7c5f08a2e3359535395f865a3255026f13d215cd by Kurt Hindenburg.
Committed on 09/02/2021 at 19:40.
Pushed by hindenburg into branch 'master'.

Add note about foreground process and using '-e cmd'

M  +4    -0    src/session/Session.cpp

https://invent.kde.org/utilities/konsole/commit/7c5f08a2e3359535395f865a3255026f13d215cd