pub fn set_tui_active(active: bool)
Mark that the TUI is active
This should be called when entering TUI mode and ensures that the panic handler knows to restore the terminal.