![]() |
libghostty-vt 0.0.0
|
#include <ghostty/vt/terminal.h>
Data Fields | |
| GhosttySemanticPromptKind | kind |
| GhosttySemanticPromptPromptKind | prompt_kind |
| bool | has_exit_code |
| int32_t | exit_code |
| GhosttyString | command |
| GhosttyString | error |
A shell integration event, passed to the GHOSTTY_TERMINAL_OPT_SEMANTIC_PROMPT callback.
kind says which step of the command this is. The other fields only carry information for the kinds listed on each field, and are zero or empty otherwise.
Strings are only valid during the callback. Copy them if you need them later.
This struct has a frozen layout and will never gain fields. It is 48 bytes on 64-bit targets and 32 bytes on wasm32. If a later version of libghostty-vt has more to report, it will add a new option with a new struct, and this callback will keep receiving this struct unchanged.
Two fields are likely to be added this way in the future:
Neither exists yet.
Definition at line 1564 of file terminal.h.
| GhosttyString command |
The command line that is about to run, for GHOSTTY_SEMANTIC_PROMPT_OUTPUT_START. The shell sends it encoded, and this is the decoded text. Empty (len=0) if the shell didn't send one or it couldn't be decoded.
Definition at line 1587 of file terminal.h.
| GhosttyString error |
A description of what went wrong, for GHOSTTY_SEMANTIC_PROMPT_COMMAND_END when the shell sent one. Empty (len=0) otherwise. Few shells send this. The exit code is the usual way to tell whether a command failed.
Definition at line 1593 of file terminal.h.
| int32_t exit_code |
The command's exit code. Only meaningful when has_exit_code is true. Exit codes can be negative, for example on Windows, so use has_exit_code rather than a special value to tell whether one was reported.
Definition at line 1581 of file terminal.h.
| bool has_exit_code |
True if the shell reported the command's exit code. Only ever true for GHOSTTY_SEMANTIC_PROMPT_COMMAND_END.
Definition at line 1575 of file terminal.h.
Which step of the command this event reports.
Definition at line 1566 of file terminal.h.
| GhosttySemanticPromptPromptKind prompt_kind |
Which prompt is starting. Set for GHOSTTY_SEMANTIC_PROMPT_PROMPT_START. Always GHOSTTY_SEMANTIC_PROMPT_PROMPT_PRIMARY for other kinds.
Definition at line 1571 of file terminal.h.