Expose semantic prompt state through C APIs

This commit is contained in:
Vishal Kapur
2026-05-27 11:14:12 -07:00
parent d2eeb734b0
commit bdb566068e
5 changed files with 56 additions and 0 deletions

View File

@@ -1134,6 +1134,7 @@ GHOSTTY_API ghostty_app_t ghostty_surface_app(ghostty_surface_t);
GHOSTTY_API ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t, ghostty_surface_context_e);
GHOSTTY_API void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t);
GHOSTTY_API bool ghostty_surface_needs_confirm_quit(ghostty_surface_t);
GHOSTTY_API bool ghostty_surface_is_at_prompt(ghostty_surface_t);
GHOSTTY_API bool ghostty_surface_process_exited(ghostty_surface_t);
GHOSTTY_API void ghostty_surface_refresh(ghostty_surface_t);
GHOSTTY_API void ghostty_surface_draw(ghostty_surface_t);

View File

@@ -1613,6 +1613,17 @@ typedef enum GHOSTTY_ENUM_TYPED {
* Output type: bool *
*/
GHOSTTY_TERMINAL_DATA_VT_GROUND = 38,
/**
* Whether the cursor is currently at a semantic shell prompt or input area.
*
* This depends on semantic prompt markers such as OSC 133. Returns false
* when semantic prompt information is unavailable or the alternate screen
* is active.
*
* Output type: bool *
*/
GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT = 39,
GHOSTTY_TERMINAL_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
} GhosttyTerminalData;