terminator icon indicating copy to clipboard operation
terminator copied to clipboard

User Help: Confirmation Promt Not Showing When Closing The Terminal With An Active Child

Open Srijan1214 opened this issue 4 years ago • 11 comments

Hello,

I am new to this software and I am trying to set up terminator to give a warning/confirmation dialog box when a process like vim is active. This is what I usually get in gnome-terminal.

I have tried following the advice here https://askubuntu.com/questions/798188/make-terminator-ask-for-permission-before-closing-if-something-is-being-executed and changed the /usr/share/terminator/terminatorlib/container.py file. I have also made sure that the suppress_multiple_term_dialog in .config/terminator/config is set to false. Yet, I have found no success in my attempts. Could someone please help me?

What Happens not want

What I desire desired

Srijan1214 avatar Jul 20 '20 07:07 Srijan1214

Cool, I think that this is actually caused by a bug. When I reproduced it, I got the following traceback:

mattrose@sorrento terminator]$ ./terminator -u 

** (terminator:421094): WARNING **: 10:25:50.613: Binding '<Control><Alt>a' failed!
Unable to bind hide_window key, another instance/window has it.
Traceback (most recent call last):
  File "/home/mattrose/Code/terminator/terminatorlib/notebook.py", line 351, in closetab
    del nb.last_active_term[child]
KeyError: <terminal.Terminal object at 0x7fe57ff97a40 (terminatorlib+terminal+Terminal at 0x555d3ae23cc0)>
<window.Window object at 0x7fe581a2eac0 (terminatorlib+window+Window at 0x555d3a9d4280)> is not in registered window list

mattrose avatar Jul 20 '20 15:07 mattrose

@mattrose Thank You for responding.

It might not be a bug because this is my first time using gnome-terminal. Most probably I might be doing something wrong. I just don't want terminator to accidentally close without prompting me.

Srijan1214 avatar Jul 21 '20 02:07 Srijan1214

You're definitely right about prompting before closing if the terminal is running processes, I just have to figure out how to do that. The traceback was possibly related, but I think there's more work to do. I am working on this.

mattrose avatar Jul 21 '20 12:07 mattrose

Found the gnome-terminal code. It's ... complex. MIght take me a bit to implement. Hopefully I can use the python-psutil lib to simplify.

mattrose avatar Jul 21 '20 14:07 mattrose

@mattrose ahh geez much appreciate the effort.

Srijan1214 avatar Jul 21 '20 18:07 Srijan1214

This is proving a lot hairier than I originally thought. Still working on it, but progress is slow.

mattrose avatar Aug 10 '20 22:08 mattrose

How is this going? Can't wait to update this feature. 😋

pha-nguyen avatar Nov 19 '21 09:11 pha-nguyen

Hello, I regularly trigger some bindings inadvertently trying to split the terminal which just closes everything. I've yet to identify the binding responsible for this.

Can I suggest in the meantime to put a "dumb" toggle setting that will ask you confirmation no matter what?

DistantThunder avatar Sep 14 '23 14:09 DistantThunder

FYI - I just got burned by the 'Binding '<Control><Alt>a' failed' issue. It caused the launched terminator window to be bound to the launching windows process rather than being independent. The fix is to go into terminator and changing the binding of '<Control><Alt>a' to something else.

Now when my script launches terminator, the launching window goes away and the terminator window persists as it should.

JavaScriptDude avatar Sep 25 '23 23:09 JavaScriptDude

Close tab by accidently

  • Click on tab close button OR
  • Midle click tab title

I also desire to this feature, Confirm before close tab

yurenchen000 avatar Dec 13 '23 20:12 yurenchen000

This is proving a lot hairier than I originally thought. Still working on it, but progress is slow.

@mattrose the gnome-terminal has this feature, which also libvte based.

Is it possible to imitate its implementation?

gnome_terminal_close-

and it's smart (only need confirm when have active task)

yurenchen000 avatar Dec 13 '23 21:12 yurenchen000