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;
} 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
typedef enum {
GHOSTTY_ACTION_QUIT,
@ -731,6 +737,7 @@ typedef enum {
GHOSTTY_ACTION_REDO,
GHOSTTY_ACTION_CHECK_FOR_UPDATES,
GHOSTTY_ACTION_OPEN_URL,
GHOSTTY_ACTION_SHOW_CHILD_EXITED
} ghostty_action_tag_e;
typedef union {
@ -759,6 +766,7 @@ typedef union {
ghostty_action_reload_config_s reload_config;
ghostty_action_config_change_s config_change;
ghostty_action_open_url_s open_url;
ghostty_surface_message_childexited_s child_exited;
} ghostty_action_u;
typedef struct {

View File

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

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Damyan Bogoev <damyan.bogoev@gmail.com>\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"
msgstr "Затвори"
@ -276,6 +276,14 @@ msgstr "Текущият процес в това разделяне ще бъд
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Главно меню"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Francesc Arpi <francesc.arpi@gmail.com>\n"
"Language-Team: \n"
@ -236,7 +236,7 @@ msgstr ""
"Enganxar aquest text al terminal pot ser perillós, ja que sembla que es "
"podrien executar algunes ordres."
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr "Tanca"
@ -276,6 +276,14 @@ msgstr "El procés actualment en execució en aquesta divisió es tancarà."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menú principal"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -228,7 +228,7 @@ msgid ""
"commands may be executed."
msgstr ""
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr ""
@ -268,6 +268,14 @@ msgstr ""
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Robin <r@rpfaeffle.com>\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 "
"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"
msgstr "Schließen"
@ -275,6 +275,14 @@ msgstr "Der aktuell laufende Prozess in diesem geteilten Fenster wird beendet."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Hauptmenü"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Alan Moyano <alanmoyano203@gmail.com>\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 "
"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"
msgstr "Cerrar"
@ -276,6 +276,14 @@ msgstr "El proceso actualmente en ejecución en esta división será terminado."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menú principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Miguel Peredo <miguelp@quientienemail.com>\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 "
"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"
msgstr "Cerrar"
@ -276,6 +276,14 @@ msgstr "El proceso actualmente en ejecución en esta división será terminado."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menú principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Kirwiisp <swiip__@hotmail.com>\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 "
"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"
msgstr "Fermer"
@ -277,6 +277,14 @@ msgstr "Le processus en cours dans ce panneau va être arrêté."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menu principal"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>\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 "
"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"
msgstr "Dún"
@ -278,6 +278,14 @@ msgstr ""
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Príomh-Roghchlár"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Sl (Shahaf Levi), Sl's Repository Ltd <ghostty@slsrepo."
"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"
msgstr "סגירה"
@ -274,6 +274,14 @@ msgstr "התהליך שרץ כרגע בפיצול זה יסתיים."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "תפריט ראשי"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Satrio Bayu Aji <halosatrio@gmail.com>\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 "
"beberapa perintah mungkin dijalankan."
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr "Tutup"
@ -275,6 +275,14 @@ msgstr "Proses yang sedang berjalan dalam belahan ini akan diakhiri."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menu utama"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Lon Sagisawa <lon@sagisawa.me>\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"
msgstr "閉じる"
@ -277,6 +277,14 @@ msgstr "分割ウィンドウ内のすべてのプロセスが終了します。
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "メインメニュー"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Hojin You <dev.hojin@gmail.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"
msgstr "닫기"
@ -276,6 +276,14 @@ msgstr "이 분할에서 현재 실행 중인 프로세스가 종료됩니다."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "메인 메뉴"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Andrej Daskalov <andrej.daskalov@gmail.com>\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"
msgstr "Затвори"
@ -276,6 +276,14 @@ msgstr "Процесот кој моментално се извршува во
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Главно мени"

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: cryptocode <cryptocode@zolo.io>\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 "
"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"
msgstr "Lukk"
@ -279,6 +279,14 @@ msgstr "Den kjørende prosessen for denne splitten vil bli avsluttet."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Hovedmeny"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Nico Geesink <geesinknico@gmail.com>\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 "
"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"
msgstr "Afsluiten"
@ -277,6 +277,14 @@ msgstr ""
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Hoofdmenu"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Bartosz Sokorski <b.sokorski@gmail.com>\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 "
"spowodować wykonanie komend."
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr "Zamknij"
@ -278,6 +278,14 @@ msgstr "Wszyskie trwające procesy w obecnym podziale zostaną zakończone."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menu główne"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Mário Victor Ribeiro Silva <mariovictorrs@gmail.com>\n"
"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 "
"comandos podem ser executados."
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr "Fechar"
@ -278,6 +278,14 @@ msgstr "O processo atual rodando nessa divisão será finalizado."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Menu Principal"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: blackzeshi <sergey_zhuzhgov@mail.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"
msgstr "Закрыть"
@ -277,6 +277,14 @@ msgstr "Процесс, работающий в этой сплит-област
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Главное меню"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: Turkish\n"
@ -237,7 +237,7 @@ msgstr ""
"Bu metni uçbirime yapıştırmak tehlikeli olabilir; çünkü bir komut "
"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"
msgstr "Kapat"
@ -277,6 +277,14 @@ msgstr "Bu bölmedeki şu anda çalışan süreç sonlandırılacaktır."
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Ana Menü"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Danylo Zalizchuk <danilmail0110@gmail.com>\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"
msgstr "Закрити"
@ -279,6 +279,14 @@ msgstr ""
msgid "Copied to clipboard"
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
msgid "Main Menu"
msgstr "Головне меню"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.mitchellh.ghostty\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"
"Last-Translator: Leah <hi@pluie.me>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@ -229,7 +229,7 @@ msgid ""
"commands may be executed."
msgstr "将以下内容粘贴至终端内将可能执行有害命令。"
#: src/apprt/gtk/CloseDialog.zig:47
#: src/apprt/gtk/CloseDialog.zig:47 src/apprt/gtk/Surface.zig:2520
msgid "Close"
msgstr "关闭"
@ -269,6 +269,14 @@ msgstr "分屏内正在运行中的进程将被终止。"
msgid "Copied to clipboard"
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
msgid "Main Menu"
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", .{});
// Update our terminal to note the abnormal exit. In the future we
// may want the apprt to handle this to show some native GUI element.
// Try and show a GUI message. If it returns true, don't do anything else.
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| {
log.err("error handling abnormal child exit err={}", .{err});
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
// completed.
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();
defer self.renderer_state.mutex.unlock();
const t: *terminal.Terminal = self.renderer_state.terminal;

View File

@ -272,6 +272,9 @@ pub const Action = union(Key) {
/// apprt.
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
pub const Key = enum(c_int) {
quit,
@ -323,6 +326,7 @@ pub const Action = union(Key) {
redo,
check_for_updates,
open_url,
show_child_exited,
};
/// Sync with: ghostty_action_u

View File

@ -521,6 +521,7 @@ pub fn performAction(
.ring_bell => try self.ringBell(target),
.toggle_command_palette => try self.toggleCommandPalette(target),
.open_url => self.openUrl(value),
.show_child_exited => return try self.showChildExited(target, value),
// Unimplemented
.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 {
switch (mode) {
.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 {
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-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.
};
pub const ChildExited = struct {
pub const ChildExited = extern struct {
exit_code: u32,
runtime_ms: u64,
};