pub enum WatcherSignal {
ToggleTui,
Interrupt,
Suspend,
Redraw,
GrowPrompt,
ShrinkPrompt,
ToggleHelp,
ExplainPulse,
ReplToggleBar,
ReplToggleWindow,
Key(KeyEvent),
}Expand description
Signals the watcher emits.
tui=terminal runs with stdin in raw mode so the watcher
can detect the toggle key (Ctrl-T). Raw mode also disables
the kernel’s normal handling of “shell control” keystrokes
— Ctrl-Z, Ctrl-L, Ctrl-C — which would otherwise be
translated to signals or interpreted by the line discipline.
The watcher recognises those keys explicitly and emits a
signal so the supervisor can reproduce the expected
behaviour (suspend, redraw, graceful shutdown) — anything a
user would normally expect from those keys keeps working.
Variants§
ToggleTui
Ctrl-T pressed. Supervisor reaction: swap the active display sink (terminal ↔ TUI).
Interrupt
Ctrl-C pressed. Supervisor reaction: forward as a
graceful-shutdown to the runtime, same path the
session_signals SIGINT handler triggers.
Suspend
Ctrl-Z pressed. Supervisor reaction: disable raw mode,
raise SIGTSTP, the OS suspends the whole process. On
resume (fg), the supervisor re-enables raw mode and
the watcher continues. Same UX a cooked-mode shell would
have given the user.
Redraw
Ctrl-L pressed. Supervisor reaction: clear the screen — the standard “redraw” behaviour for cooked terminals.
GrowPrompt
Alt+Up pressed. Supervisor reaction: grow the prompt window by one row.
ShrinkPrompt
Alt+Down pressed. Supervisor reaction: shrink the prompt window by one row.
ToggleHelp
Ctrl-/ pressed. Supervisor reaction: toggle the prompt’s keystroke-help overlay.
ExplainPulse
? pressed. Supervisor reaction: call
observer::toggle_explain() — toggle the explainer
overlay on (with a 10 s auto-revert deadline) or off
(if it was already on). Auto-repeat from holding the
key is swallowed by the toggle’s own debounce.
ReplToggleBar
~ pressed. Supervisor reaction: cycle the REPL
visibility through Hidden → Bar → Hidden (and Window
→ Hidden if currently Window). Tilde is the universal
“toggle off” key — pressing it from any visible state
returns to Hidden. See crate::repl_state for the
full state machine.
ReplToggleWindow
Backtick (`) pressed. Supervisor reaction: open
the full-screen REPL window (or close it if already
open). Chosen instead of Ctrl-~ because the latter
proved unreliable across terminals — many terminal
emulators intercept or fail to deliver the chord. A
bare key with a single keysym + no modifier dependency
works uniformly across stock terminals. See
crate::repl_state for the full state machine.
Key(KeyEvent)
Any other keypress — printable chars, line-editing
chords, history nav, Enter, etc. Forwarded to the
prompt without interpretation. Supervisor receives the
raw crossterm::event::KeyEvent inside Self::Key
so the [crate::prompt_state::PromptState] can apply
the same key translation as a terminal-native editor.
Trait Implementations§
Source§impl Clone for WatcherSignal
impl Clone for WatcherSignal
impl Copy for WatcherSignal
Source§impl Debug for WatcherSignal
impl Debug for WatcherSignal
impl Eq for WatcherSignal
Source§impl PartialEq for WatcherSignal
impl PartialEq for WatcherSignal
impl StructuralPartialEq for WatcherSignal
Auto Trait Implementations§
impl Forget for WatcherSignal
impl Freeze for WatcherSignal
impl Move for WatcherSignal
impl RefUnwindSafe for WatcherSignal
impl Send for WatcherSignal
impl Sync for WatcherSignal
impl Unpin for WatcherSignal
impl UnsafeUnpin for WatcherSignal
impl UnwindSafe for WatcherSignal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more