From 07124dba64096a36a84b76cab05a937ea3e2aeac Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Wed, 1 Oct 2025 23:48:08 -0500 Subject: core: add 'command finished' notifications Fixes #8991 Uses OSC 133 esc sequences to keep track of how long commands take to execute. If the user chooses, commands that take longer than a user specified limit will trigger a notification. The user can choose between a bell notification or a desktop notification. --- include/ghostty.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/ghostty.h b/include/ghostty.h index 3f1e0c9d9..48836ee96 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -733,6 +733,14 @@ typedef struct { int8_t progress; } ghostty_action_progress_report_s; +// apprt.action.CommandFinished.C +typedef struct { + // -1 if no exit code was reported, otherwise 0-255 + int16_t exit_code; + // number of nanoseconds that command was running for + uint64_t duration; +} ghostty_action_command_finished_s; + // apprt.Action.Key typedef enum { GHOSTTY_ACTION_QUIT, @@ -788,6 +796,7 @@ typedef enum { GHOSTTY_ACTION_SHOW_CHILD_EXITED, GHOSTTY_ACTION_PROGRESS_REPORT, GHOSTTY_ACTION_SHOW_ON_SCREEN_KEYBOARD, + GHOSTTY_ACTION_COMMAND_FINISHED, } ghostty_action_tag_e; typedef union { @@ -819,6 +828,7 @@ typedef union { ghostty_action_close_tab_mode_e close_tab_mode; ghostty_surface_message_childexited_s child_exited; ghostty_action_progress_report_s progress_report; + ghostty_action_command_finished_s command_finished; } ghostty_action_u; typedef struct { -- cgit v1.2.3