gnome-shell-extension-ddterm
gnome-shell-extension-ddterm copied to clipboard
Ask for confirmation when closing a tab
At least if there are more processes than just the shell
It seems that rewriting Gnome Terminal's foreground process detection in Gjs isn't possible (or maybe there is something like ctypes in gjs?): https://gitlab.gnome.org/GNOME/gnome-terminal/-/blob/master/src/terminal-screen.c#L2218
Actually, tcgetpgrp seems to be the only function necessary. However, there is no introspectable wrapper for it.
js-ctypes looked promising https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes , but there is no ctypes global in gjs:
gjs> ctypes
typein:1:1 ReferenceError: ctypes is not defined
@typein:1:1
@<stdin>:1:42
https://gitlab.gnome.org/GNOME/vte/-/issues/327