1

Please note: This is about GNOME Console, not GNOME Terminal.

How do I stop these prompts from appearing when closing GNOME Console?

"Close Window?" prompt

(In my case, the window is also misleading. It appears even when the background process is disowned. Disowned processes are no longer children of the original shell, so they survive closing the terminal just fine.)

l0b0
  • 51,350

1 Answers1

1

Mind going into the code ? (since I did not manage to find any sort of accessible parameter to avoid the closing confirm window.)
First try : Quick and Dirty way just to see if its works according to what you wish.

Reading kgx_window.c from line 155 , roughly :

kgx_window_close_request (GtkWindow *window)
{
…
  children = kgx_pages_get_children (KGX_PAGES (priv->pages));
  if (children->len < 1 || priv->close_anyway) {
    if (gtk_window_is_active (GTK_WINDOW (self))) {
      …}
    return FALSE; /* Aka no, I don’t want to block closing */}

dlg = g_object_new (KGX_TYPE_CLOSE_DIALOG, "context", KGX_CONTEXT_WINDOW, "commands", children, "transient-for", self, NULL); kgx_close_dialog_run (dlg, NULL, got_close, g_object_ref (self)); return TRUE; /* Block the close */}

We understand that we might be able to always bypass the close confirmation window if kgx_window_close_request always returns FALSE.

I would therefore suggest to comment out :

  • Line 164 ( if (children->len < 1 || priv->close_anyway) { )
  • Line 169 (the associated closing brace.)

Note that it would certainly be preferable to just force priv->close_anyway to TRUE since the confirmation would also be skipped as also specified at the beginning of the code :

  • KgxWindow: * @close_anyway: ignore running children and close without prompt

but I had no time to find my way to force this.

MC68020
  • 7,981
  • Behold the awesome power of Nix! Ehem. There seemed to be one other place I had to modify to get this to work, but thank you very much for the idea! – l0b0 Nov 18 '23 at 21:26
  • @l0b0 : Good catch ! I had not considered kgx-pages.c ! My bad ! Nevermind, I keep on thinking that the clean way would be to go with the setting of close_anyway via some tuneable. Happy it fits your purpose & thanks for the bounty. – MC68020 Nov 18 '23 at 22:16