core/gtk: add apprt action to show native GUI warning when child exits (#7836)

Addresses #7649 for the core and GTK. macOS support will need to be
added later.

This adds an apprt action to show a native GUI warning of some kind when
the child process of a terminal exits.

Also adds a basic GTK implementation of this. In GTK it overlays an
Adwaita banner at the bottom of the window (similar to the banner that
shows up in at the top of windows in debug builds).
![Screenshot From 2025-07-08
14-49-59](https://github.com/user-attachments/assets/5de4c065-6b35-4ef5-ba26-171c40c0c5ee)
![Screenshot From 2025-07-08
14-50-14](https://github.com/user-attachments/assets/d6259aa1-6eb2-4c7f-9a9b-13dbad706a3e)
This commit is contained in:
Jeffrey C. Ollie
2025-07-11 23:14:18 -05:00
committed by GitHub
29 changed files with 306 additions and 45 deletions

View File

@ -680,6 +680,12 @@ typedef struct {
uintptr_t len; uintptr_t len;
} ghostty_action_open_url_s; } ghostty_action_open_url_s;
// apprt.surface.Message.ChildExited
typedef struct {
uint32_t exit_code;
uint64_t timetime_ms;
} ghostty_surface_message_childexited_s;
// apprt.Action.Key // apprt.Action.Key
typedef enum { typedef enum {
GHOSTTY_ACTION_QUIT, GHOSTTY_ACTION_QUIT,
@ -731,6 +737,7 @@ typedef enum {
GHOSTTY_ACTION_REDO, GHOSTTY_ACTION_REDO,
GHOSTTY_ACTION_CHECK_FOR_UPDATES, GHOSTTY_ACTION_CHECK_FOR_UPDATES,
GHOSTTY_ACTION_OPEN_URL, GHOSTTY_ACTION_OPEN_URL,
GHOSTTY_ACTION_SHOW_CHILD_EXITED
} ghostty_action_tag_e; } ghostty_action_tag_e;
typedef union { typedef union {
@ -759,6 +766,7 @@ typedef union {
ghostty_action_reload_config_s reload_config; ghostty_action_reload_config_s reload_config;
ghostty_action_config_change_s config_change; ghostty_action_config_change_s config_change;
ghostty_action_open_url_s open_url; ghostty_action_open_url_s open_url;
ghostty_surface_message_childexited_s child_exited;
} ghostty_action_u; } ghostty_action_u;
typedef struct { typedef struct {

View File

@ -579,6 +579,8 @@ extension Ghostty {
case GHOSTTY_ACTION_SIZE_LIMIT: case GHOSTTY_ACTION_SIZE_LIMIT:
fallthrough fallthrough
case GHOSTTY_ACTION_QUIT_TIMER: case GHOSTTY_ACTION_QUIT_TIMER:
fallthrough
case GHOSTTY_ACTION_SHOW_CHILD_EXITED:
Ghostty.logger.info("known but unimplemented action action=\(action.tag.rawValue)") Ghostty.logger.info("known but unimplemented action action=\(action.tag.rawValue)")
return false return false
default: default:

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-05-19 11:34+0300\n" "PO-Revision-Date: 2025-05-19 11:34+0300\n"
"Last-Translator: Damyan Bogoev <damyan.bogoev@gmail.com>\n" "Last-Translator: Damyan Bogoev <damyan.bogoev@gmail.com>\n"
"Language-Team: Bulgarian <dict@ludost.net>\n" "Language-Team: Bulgarian <dict@ludost.net>\n"
@ -236,7 +236,7 @@ msgstr ""
"Поставянето на този текст в терминала може да е опасно, тъй като изглежда, " "Поставянето на този текст в терминала може да е опасно, тъй като изглежда, "
"че може да бъдат изпълнени някои команди." "че може да бъдат изпълнени някои команди."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Затвори" msgstr "Затвори"
@ -276,6 +276,14 @@ msgstr "Текущият процес в това разделяне ще бъд
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Копирано в клипборда" msgstr "Копирано в клипборда"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Главно меню" msgstr "Главно меню"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-20 08:07+0100\n" "PO-Revision-Date: 2025-03-20 08:07+0100\n"
"Last-Translator: Francesc Arpi <francesc.arpi@gmail.com>\n" "Last-Translator: Francesc Arpi <francesc.arpi@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -236,7 +236,7 @@ msgstr ""
"Enganxar aquest text al terminal pot ser perillós, ja que sembla que es " "Enganxar aquest text al terminal pot ser perillós, ja que sembla que es "
"podrien executar algunes ordres." "podrien executar algunes ordres."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Tanca" msgstr "Tanca"
@ -276,6 +276,14 @@ msgstr "El procés actualment en execució en aquesta divisió es tancarà."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Copiat al porta-retalls" msgstr "Copiat al porta-retalls"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menú principal" msgstr "Menú principal"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -228,7 +228,7 @@ msgid ""
"commands may be executed." "commands may be executed."
msgstr "" msgstr ""
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "" msgstr ""
@ -268,6 +268,14 @@ msgstr ""
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "" msgstr ""
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-06 14:57+0100\n" "PO-Revision-Date: 2025-03-06 14:57+0100\n"
"Last-Translator: Robin <r@rpfaeffle.com>\n" "Last-Translator: Robin <r@rpfaeffle.com>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@ -235,7 +235,7 @@ msgstr ""
"Diesen Text in das Terminal einzufügen könnte möglicherweise gefährlich " "Diesen Text in das Terminal einzufügen könnte möglicherweise gefährlich "
"sein. Es scheint, dass Anweisungen ausgeführt werden könnten." "sein. Es scheint, dass Anweisungen ausgeführt werden könnten."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Schließen" msgstr "Schließen"
@ -275,6 +275,14 @@ msgstr "Der aktuell laufende Prozess in diesem geteilten Fenster wird beendet."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "In die Zwischenablage kopiert" msgstr "In die Zwischenablage kopiert"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Hauptmenü" msgstr "Hauptmenü"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-05-19 20:17-0300\n" "PO-Revision-Date: 2025-05-19 20:17-0300\n"
"Last-Translator: Alan Moyano <alanmoyano203@gmail.com>\n" "Last-Translator: Alan Moyano <alanmoyano203@gmail.com>\n"
"Language-Team: Argentinian <es@tp.org.es>\n" "Language-Team: Argentinian <es@tp.org.es>\n"
@ -236,7 +236,7 @@ msgstr ""
"Pegar este texto en la terminal puede ser peligroso ya que parece que " "Pegar este texto en la terminal puede ser peligroso ya que parece que "
"algunos comandos podrían ejecutarse." "algunos comandos podrían ejecutarse."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
@ -276,6 +276,14 @@ msgstr "El proceso actualmente en ejecución en esta división será terminado."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Copiado al portapapeles" msgstr "Copiado al portapapeles"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menú principal" msgstr "Menú principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-28 17:46+0200\n" "PO-Revision-Date: 2025-03-28 17:46+0200\n"
"Last-Translator: Miguel Peredo <miguelp@quientienemail.com>\n" "Last-Translator: Miguel Peredo <miguelp@quientienemail.com>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
@ -236,7 +236,7 @@ msgstr ""
"Pegar este texto en la terminal puede ser peligroso ya que parece que " "Pegar este texto en la terminal puede ser peligroso ya que parece que "
"algunos comandos podrían ejecutarse." "algunos comandos podrían ejecutarse."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
@ -276,6 +276,14 @@ msgstr "El proceso actualmente en ejecución en esta división será terminado."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Copiado al portapapeles" msgstr "Copiado al portapapeles"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menú principal" msgstr "Menú principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-22 09:31+0100\n" "PO-Revision-Date: 2025-03-22 09:31+0100\n"
"Last-Translator: Kirwiisp <swiip__@hotmail.com>\n" "Last-Translator: Kirwiisp <swiip__@hotmail.com>\n"
"Language-Team: French <traduc@traduc.org>\n" "Language-Team: French <traduc@traduc.org>\n"
@ -237,7 +237,7 @@ msgstr ""
"Coller ce texte dans le terminal pourrait être dangereux, il semblerait que " "Coller ce texte dans le terminal pourrait être dangereux, il semblerait que "
"certaines commandes pourraient être exécutées." "certaines commandes pourraient être exécutées."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Fermer" msgstr "Fermer"
@ -277,6 +277,14 @@ msgstr "Le processus en cours dans ce panneau va être arrêté."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Copié dans le presse-papiers" msgstr "Copié dans le presse-papiers"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu principal" msgstr "Menu principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-06-29 21:15+0100\n" "PO-Revision-Date: 2025-06-29 21:15+0100\n"
"Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n" "Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\n"
"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n" "Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
@ -237,7 +237,7 @@ msgstr ""
"Dfhéadfadh sé a bheith contúirteach an téacs seo a ghreamú isteach sa " "Dfhéadfadh sé a bheith contúirteach an téacs seo a ghreamú isteach sa "
"teirminéal, toisc go d'fhéadfadh roinnt orduithe a fhorghníomhú." "teirminéal, toisc go d'fhéadfadh roinnt orduithe a fhorghníomhú."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Dún" msgstr "Dún"
@ -278,6 +278,14 @@ msgstr ""
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Cóipeáilte chuig an ghearrthaisce" msgstr "Cóipeáilte chuig an ghearrthaisce"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Príomh-Roghchlár" msgstr "Príomh-Roghchlár"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-13 00:00+0000\n" "PO-Revision-Date: 2025-03-13 00:00+0000\n"
"Last-Translator: Sl (Shahaf Levi), Sl's Repository Ltd <ghostty@slsrepo." "Last-Translator: Sl (Shahaf Levi), Sl's Repository Ltd <ghostty@slsrepo."
"com>\n" "com>\n"
@ -234,7 +234,7 @@ msgstr ""
"הדבקת טקסט זה במסוף עלולה להיות מסוכנת, מכיוון שככל הנראה היא תוביל להרצה של " "הדבקת טקסט זה במסוף עלולה להיות מסוכנת, מכיוון שככל הנראה היא תוביל להרצה של "
"פקודות מסוימות." "פקודות מסוימות."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "סגירה" msgstr "סגירה"
@ -274,6 +274,14 @@ msgstr "התהליך שרץ כרגע בפיצול זה יסתיים."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "הועתק ללוח ההעתקה" msgstr "הועתק ללוח ההעתקה"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "תפריט ראשי" msgstr "תפריט ראשי"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-20 15:19+0700\n" "PO-Revision-Date: 2025-03-20 15:19+0700\n"
"Last-Translator: Satrio Bayu Aji <halosatrio@gmail.com>\n" "Last-Translator: Satrio Bayu Aji <halosatrio@gmail.com>\n"
"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n" "Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
@ -235,7 +235,7 @@ msgstr ""
"Menempelkan teks ini ke terminal mungkin berbahaya karena sepertinya " "Menempelkan teks ini ke terminal mungkin berbahaya karena sepertinya "
"beberapa perintah mungkin dijalankan." "beberapa perintah mungkin dijalankan."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Tutup" msgstr "Tutup"
@ -275,6 +275,14 @@ msgstr "Proses yang sedang berjalan dalam belahan ini akan diakhiri."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Disalin ke papan klip" msgstr "Disalin ke papan klip"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu utama" msgstr "Menu utama"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-21 00:08+0900\n" "PO-Revision-Date: 2025-03-21 00:08+0900\n"
"Last-Translator: Lon Sagisawa <lon@sagisawa.me>\n" "Last-Translator: Lon Sagisawa <lon@sagisawa.me>\n"
"Language-Team: Japanese\n" "Language-Team: Japanese\n"
@ -237,7 +237,7 @@ msgstr ""
"このテキストには実行可能なコマンドが含まれており、ターミナルに貼り付けるのは" "このテキストには実行可能なコマンドが含まれており、ターミナルに貼り付けるのは"
"危険な可能性があります。" "危険な可能性があります。"
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "閉じる" msgstr "閉じる"
@ -277,6 +277,14 @@ msgstr "分割ウィンドウ内のすべてのプロセスが終了します。
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "クリップボードにコピーしました" msgstr "クリップボードにコピーしました"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "メインメニュー" msgstr "メインメニュー"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-07-09 16:11-0400\n" "PO-Revision-Date: 2025-07-09 16:11-0400\n"
"Last-Translator: Hojin You <dev.hojin@gmail.com>\n" "Last-Translator: Hojin You <dev.hojin@gmail.com>\n"
"Language-Team: Korean <translation-team-ko@googlegroups.com>\n" "Language-Team: Korean <translation-team-ko@googlegroups.com>\n"
@ -236,7 +236,7 @@ msgstr ""
"이 텍스트를 터미널에 붙여넣는 것은 위험할 수 있습니다. 일부 명령이 실행될 수 " "이 텍스트를 터미널에 붙여넣는 것은 위험할 수 있습니다. 일부 명령이 실행될 수 "
"있는 것으로 보입니다." "있는 것으로 보입니다."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "닫기" msgstr "닫기"
@ -276,6 +276,14 @@ msgstr "이 분할에서 현재 실행 중인 프로세스가 종료됩니다."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "클립보드에 복사됨" msgstr "클립보드에 복사됨"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "메인 메뉴" msgstr "메인 메뉴"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-23 14:17+0100\n" "PO-Revision-Date: 2025-03-23 14:17+0100\n"
"Last-Translator: Andrej Daskalov <andrej.daskalov@gmail.com>\n" "Last-Translator: Andrej Daskalov <andrej.daskalov@gmail.com>\n"
"Language-Team: Macedonian\n" "Language-Team: Macedonian\n"
@ -236,7 +236,7 @@ msgstr ""
"Вметнувањето на овој текст во терминалот може да биде опасно, бидејќи " "Вметнувањето на овој текст во терминалот може да биде опасно, бидејќи "
"изгледа како да ќе се извршат одредени команди." "изгледа како да ќе се извршат одредени команди."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Затвори" msgstr "Затвори"
@ -276,6 +276,14 @@ msgstr "Процесот кој моментално се извршува во
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Копирано во привремена меморија" msgstr "Копирано во привремена меморија"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Главно мени" msgstr "Главно мени"

View File

@ -10,7 +10,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-04-14 16:25+0200\n" "PO-Revision-Date: 2025-04-14 16:25+0200\n"
"Last-Translator: cryptocode <cryptocode@zolo.io>\n" "Last-Translator: cryptocode <cryptocode@zolo.io>\n"
"Language-Team: Norwegian Bokmal <l10n-no@lister.huftis.org>\n" "Language-Team: Norwegian Bokmal <l10n-no@lister.huftis.org>\n"
@ -239,7 +239,7 @@ msgstr ""
"Det ser ut som at kommandoer vil bli kjørt hvis du limer inn dette, vurder " "Det ser ut som at kommandoer vil bli kjørt hvis du limer inn dette, vurder "
"om du mener det er trygt." "om du mener det er trygt."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Lukk" msgstr "Lukk"
@ -279,6 +279,14 @@ msgstr "Den kjørende prosessen for denne splitten vil bli avsluttet."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Kopiert til utklippstavlen" msgstr "Kopiert til utklippstavlen"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Hovedmeny" msgstr "Hovedmeny"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-24 15:00+0100\n" "PO-Revision-Date: 2025-03-24 15:00+0100\n"
"Last-Translator: Nico Geesink <geesinknico@gmail.com>\n" "Last-Translator: Nico Geesink <geesinknico@gmail.com>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n" "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
@ -236,7 +236,7 @@ msgstr ""
"Het plakken van deze tekst in de terminal is mogelijk gevaarlijk, omdat het " "Het plakken van deze tekst in de terminal is mogelijk gevaarlijk, omdat het "
"lijkt op een commando dat uitgevoerd kan worden." "lijkt op een commando dat uitgevoerd kan worden."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Afsluiten" msgstr "Afsluiten"
@ -277,6 +277,14 @@ msgstr ""
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Gekopieerd naar klembord" msgstr "Gekopieerd naar klembord"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Hoofdmenu" msgstr "Hoofdmenu"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-17 12:15+0100\n" "PO-Revision-Date: 2025-03-17 12:15+0100\n"
"Last-Translator: Bartosz Sokorski <b.sokorski@gmail.com>\n" "Last-Translator: Bartosz Sokorski <b.sokorski@gmail.com>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n" "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@ -238,7 +238,7 @@ msgstr ""
"Wklejenie tego tekstu do terminala może być niebezpieczne, ponieważ może " "Wklejenie tego tekstu do terminala może być niebezpieczne, ponieważ może "
"spowodować wykonanie komend." "spowodować wykonanie komend."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Zamknij" msgstr "Zamknij"
@ -278,6 +278,14 @@ msgstr "Wszyskie trwające procesy w obecnym podziale zostaną zakończone."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Skopiowano do schowka" msgstr "Skopiowano do schowka"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu główne" msgstr "Menu główne"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-06-20 10:19-0300\n" "PO-Revision-Date: 2025-06-20 10:19-0300\n"
"Last-Translator: Mário Victor Ribeiro Silva <mariovictorrs@gmail.com>\n" "Last-Translator: Mário Victor Ribeiro Silva <mariovictorrs@gmail.com>\n"
"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge." "Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
@ -238,7 +238,7 @@ msgstr ""
"Colar esse texto em um terminal pode ser perigoso, pois parece que alguns " "Colar esse texto em um terminal pode ser perigoso, pois parece que alguns "
"comandos podem ser executados." "comandos podem ser executados."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Fechar" msgstr "Fechar"
@ -278,6 +278,14 @@ msgstr "O processo atual rodando nessa divisão será finalizado."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Copiado para a área de transferência" msgstr "Copiado para a área de transferência"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu Principal" msgstr "Menu Principal"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-24 00:01+0500\n" "PO-Revision-Date: 2025-03-24 00:01+0500\n"
"Last-Translator: blackzeshi <sergey_zhuzhgov@mail.ru>\n" "Last-Translator: blackzeshi <sergey_zhuzhgov@mail.ru>\n"
"Language-Team: Russian <gnu@d07.ru>\n" "Language-Team: Russian <gnu@d07.ru>\n"
@ -237,7 +237,7 @@ msgstr ""
"Вставка этого текста в терминал может быть опасной. Это выглядит как " "Вставка этого текста в терминал может быть опасной. Это выглядит как "
"команды, которые могут быть исполнены." "команды, которые могут быть исполнены."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Закрыть" msgstr "Закрыть"
@ -277,6 +277,14 @@ msgstr "Процесс, работающий в этой сплит-област
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Скопировано в буфер обмена" msgstr "Скопировано в буфер обмена"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Главное меню" msgstr "Главное меню"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-24 22:01+0300\n" "PO-Revision-Date: 2025-03-24 22:01+0300\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: Turkish\n" "Language-Team: Turkish\n"
@ -237,7 +237,7 @@ msgstr ""
"Bu metni uçbirime yapıştırmak tehlikeli olabilir; çünkü bir komut " "Bu metni uçbirime yapıştırmak tehlikeli olabilir; çünkü bir komut "
"yürütülebilecekmiş gibi duruyor." "yürütülebilecekmiş gibi duruyor."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Kapat" msgstr "Kapat"
@ -277,6 +277,14 @@ msgstr "Bu bölmedeki şu anda çalışan süreç sonlandırılacaktır."
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Panoya kopyalandı" msgstr "Panoya kopyalandı"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Ana Menü" msgstr "Ana Menü"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-03-16 20:16+0200\n" "PO-Revision-Date: 2025-03-16 20:16+0200\n"
"Last-Translator: Danylo Zalizchuk <danilmail0110@gmail.com>\n" "Last-Translator: Danylo Zalizchuk <danilmail0110@gmail.com>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n" "Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
@ -238,7 +238,7 @@ msgstr ""
"Вставка цього тексту в термінал може бути небезпечною, оскільки виглядає " "Вставка цього тексту в термінал може бути небезпечною, оскільки виглядає "
"так, ніби деякі команди можуть бути виконані." "так, ніби деякі команди можуть бути виконані."
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "Закрити" msgstr "Закрити"
@ -279,6 +279,14 @@ msgstr ""
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "Скопійовано в буфер обміну" msgstr "Скопійовано в буфер обміну"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "Головне меню" msgstr "Головне меню"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\n" "Project-Id-Version: com.mitchellh.ghostty\n"
"Report-Msgid-Bugs-To: m@mitchellh.com\n" "Report-Msgid-Bugs-To: m@mitchellh.com\n"
"POT-Creation-Date: 2025-07-08 15:13-0500\n" "POT-Creation-Date: 2025-07-11 22:56-0500\n"
"PO-Revision-Date: 2025-02-27 09:16+0100\n" "PO-Revision-Date: 2025-02-27 09:16+0100\n"
"Last-Translator: Leah <hi@pluie.me>\n" "Last-Translator: Leah <hi@pluie.me>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@ -229,7 +229,7 @@ msgid ""
"commands may be executed." "commands may be executed."
msgstr "将以下内容粘贴至终端内将可能执行有害命令。" msgstr "将以下内容粘贴至终端内将可能执行有害命令。"
#: src/apprt/gtk/CloseDialog.zig:47 #: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close" msgid "Close"
msgstr "关闭" msgstr "关闭"
@ -269,6 +269,14 @@ msgstr "分屏内正在运行中的进程将被终止。"
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "已复制至剪贴板" msgstr "已复制至剪贴板"
#: src/apprt/gtk/Surface.zig:2514
msgid "Command succeeded"
msgstr ""
#: src/apprt/gtk/Surface.zig:2516
msgid "Command failed"
msgstr ""
#: src/apprt/gtk/Window.zig:216 #: src/apprt/gtk/Window.zig:216
msgid "Main Menu" msgid "Main Menu"
msgstr "主菜单" msgstr "主菜单"

View File

@ -1011,8 +1011,18 @@ fn childExited(self: *Surface, info: apprt.surface.Message.ChildExited) void {
log.warn("abnormal process exit detected, showing error message", .{}); log.warn("abnormal process exit detected, showing error message", .{});
// Update our terminal to note the abnormal exit. In the future we // Try and show a GUI message. If it returns true, don't do anything else.
// may want the apprt to handle this to show some native GUI element. if (self.rt_app.performAction(
.{ .surface = self },
.show_child_exited,
info,
) catch |err| gui: {
log.err("error trying to show native child exited GUI err={}", .{err});
break :gui false;
}) return;
// If a native GUI notification was not showm. update our terminal to
// note the abnormal exit.
self.childExitedAbnormally(info) catch |err| { self.childExitedAbnormally(info) catch |err| {
log.err("error handling abnormal child exit err={}", .{err}); log.err("error handling abnormal child exit err={}", .{err});
return; return;
@ -1028,6 +1038,18 @@ fn childExited(self: *Surface, info: apprt.surface.Message.ChildExited) void {
// surface then they will see this message and know the process has // surface then they will see this message and know the process has
// completed. // completed.
terminal: { terminal: {
// First try and show a native GUI message.
if (self.rt_app.performAction(
.{ .surface = self },
.show_child_exited,
info,
) catch |err| gui: {
log.err("error trying to show native child exited GUI err={}", .{err});
break :gui false;
}) break :terminal;
// If the native GUI can't be shown, display a text message in the
// terminal.
self.renderer_state.mutex.lock(); self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock(); defer self.renderer_state.mutex.unlock();
const t: *terminal.Terminal = self.renderer_state.terminal; const t: *terminal.Terminal = self.renderer_state.terminal;

View File

@ -272,6 +272,9 @@ pub const Action = union(Key) {
/// apprt. /// apprt.
open_url: OpenUrl, open_url: OpenUrl,
/// Show a native GUI notification that the child process has exited.
show_child_exited: apprt.surface.Message.ChildExited,
/// Sync with: ghostty_action_tag_e /// Sync with: ghostty_action_tag_e
pub const Key = enum(c_int) { pub const Key = enum(c_int) {
quit, quit,
@ -323,6 +326,7 @@ pub const Action = union(Key) {
redo, redo,
check_for_updates, check_for_updates,
open_url, open_url,
show_child_exited,
}; };
/// Sync with: ghostty_action_u /// Sync with: ghostty_action_u

View File

@ -521,6 +521,7 @@ pub fn performAction(
.ring_bell => try self.ringBell(target), .ring_bell => try self.ringBell(target),
.toggle_command_palette => try self.toggleCommandPalette(target), .toggle_command_palette => try self.toggleCommandPalette(target),
.open_url => self.openUrl(value), .open_url => self.openUrl(value),
.show_child_exited => return try self.showChildExited(target, value),
// Unimplemented // Unimplemented
.close_all_windows, .close_all_windows,
@ -846,6 +847,13 @@ fn toggleCommandPalette(_: *App, target: apprt.Target) !void {
} }
} }
fn showChildExited(_: *App, target: apprt.Target, value: apprt.surface.Message.ChildExited) error{}!bool {
switch (target) {
.app => return false,
.surface => |surface| return try surface.rt_surface.showChildExited(value),
}
}
fn quitTimer(self: *App, mode: apprt.action.QuitTimer) void { fn quitTimer(self: *App, mode: apprt.action.QuitTimer) void {
switch (mode) { switch (mode) {
.start => self.startQuitTimer(), .start => self.startQuitTimer(),

View File

@ -2503,3 +2503,40 @@ fn gtkStreamError(media_file: *gtk.MediaFile, _: *gobject.ParamSpec, _: ?*anyopa
fn gtkStreamEnded(media_file: *gtk.MediaFile, _: *gobject.ParamSpec, _: ?*anyopaque) callconv(.c) void { fn gtkStreamEnded(media_file: *gtk.MediaFile, _: *gobject.ParamSpec, _: ?*anyopaque) callconv(.c) void {
media_file.unref(); media_file.unref();
} }
/// Show native GUI element with a notification that the child process has
/// closed. Return `true` if we are able to show the GUI notification, and
/// `false` if we are not.
pub fn showChildExited(self: *Surface, info: apprt.surface.Message.ChildExited) error{}!bool {
if (!adw_version.supportsBanner()) return false;
const warning_text, const css_class = if (info.exit_code == 0)
.{ i18n._("Command succeeded"), "child_exited_normally" }
else
.{ i18n._("Command failed"), "child_exited_abnormally" };
const banner = adw.Banner.new(warning_text);
banner.setRevealed(1);
banner.setButtonLabel(i18n._("Close"));
_ = adw.Banner.signals.button_clicked.connect(
banner,
*Surface,
showChildExitedButtonClosed,
self,
.{},
);
const banner_widget = banner.as(gtk.Widget);
banner_widget.setHalign(.fill);
banner_widget.setValign(.end);
banner_widget.addCssClass(css_class);
self.overlay.addOverlay(banner_widget);
return true;
}
fn showChildExitedButtonClosed(_: *adw.Banner, self: *Surface) callconv(.c) void {
self.close(false);
}

View File

@ -93,3 +93,15 @@ window.ssd.no-border-radius {
margin-left: 4px; margin-left: 4px;
margin-right: 8px; margin-right: 8px;
} }
banner.child_exited_normally revealer widget {
background-color: rgba(38, 162, 105, 0.5);
/* after GTK 4.16 is a requirement, switch to the following:
/* background-color: color-mix(in srgb, var(--success-bg-color), transparent 50%); */
}
banner.child_exited_abnormally revealer widget {
background-color: rgba(192, 28, 40, 0.5);
/* after GTK 4.16 is a requirement, switch to the following:
/* background-color: color-mix(in srgb, var(--error-bg-color), transparent 50%); */
}

View File

@ -98,7 +98,7 @@ pub const Message = union(enum) {
// This enum is a placeholder for future title styles. // This enum is a placeholder for future title styles.
}; };
pub const ChildExited = struct { pub const ChildExited = extern struct {
exit_code: u32, exit_code: u32,
runtime_ms: u64, runtime_ms: u64,
}; };