pub enum Event {
Show 15 variants
PasteUpload {
id: u64,
text: Arc<str>,
},
PasteCancelled {
id: u64,
},
Line(String),
Eof,
CancelPrompt,
Resize {
width: u16,
height: u16,
},
FocusChanged {
focused: bool,
},
BufferChanged,
CompletionRefresh,
CompletionAccept,
BackTab,
Escape,
Binding(String),
Notice(String),
ExternalEditor,
}Expand description
High-level events surfaced to the downstream event loop.
Variants§
PasteUpload
Upload normalized text without exposing it to the editable draft.
Fields
PasteCancelled
Discard the pending paste; the original draft remains unchanged.
Line(String)
The user submitted a line with Ctrl-Enter or submit-prompt
outside the completion menu, or with no candidate selected.
Eof
The user signalled EOF (Ctrl-D on empty line).
CancelPrompt
The user requested prompt cancellation with a second consecutive Ctrl-C.
Resize
The terminal was resized.
FocusChanged
The terminal reported focus gained or lost.
BufferChanged
The input buffer or completion menu state changed. Fires for keystrokes that mutate the buffer and for completion menu open/close/cycle. Caller should re-render anything that depends on either (typically the menu and the prompt itself).
CompletionRefresh
A background owner requested that the completion menu be recomputed without changing the prompt buffer.
CompletionAccept
The user pressed Ctrl-Enter with a candidate previewed in the menu. The buffer is now the candidate’s accepted replacement and completion has been re-evaluated for that buffer. The caller should re-render the menu area but typically should not submit — a second Ctrl-Enter is expected to confirm.
BackTab
The user pressed Shift-Tab outside an open completion menu. Inside a menu it cycles backwards and is consumed internally.
Escape
The user pressed Escape outside an open completion menu.
Binding(String)
The user activated a configured key binding.
Notice(String)
A local prompt notice should be printed above the prompt.
ExternalEditor
The user requested an external editor (Ctrl-O / Ctrl-G).
Caller is expected to call Term::pause_for_external, spawn
$VISUAL/$EDITOR, and call Term::resume_after_external.