Skip to main content

Module panic_hook

Module panic_hook 

Source
Expand description

Panic hook implementation for terminal UI applications This module provides a panic hook that restores terminal state when a panic occurs, preventing terminal corruption, and provides enhanced panic formatting for different build types.

Structs§

TuiPanicGuard
A guard struct that automatically registers and unregisters TUI state with the panic hook system.

Functions§

init_panic_hook
Initialize the panic hook to restore terminal state on panic and provide better formatting
is_debug_mode
Get whether the application is in debug mode
mark_tui_deinitialized
Mark that TUI has been deinitialized to prevent further restoration attempts
mark_tui_initialized
Mark that TUI has been initialized so panic hook knows to restore terminal
restore_tui
Restore terminal to a usable state after a panic
set_debug_mode
Set whether the application is in debug mode
set_show_diagnostics
Set whether diagnostics (ERROR-level logs, warnings) should be displayed in the TUI. Driven by ui.show_diagnostics_in_transcript in vtcode.toml.
show_diagnostics
Get whether diagnostics should be displayed in the TUI