pub fn try_init_with_options(
options: TerminalOptions,
screen_options: ProgramOptions,
) -> Result<DefaultTerminal>Expand description
Initialize a terminal with explicit terminal and screen options.
Setup constructs a Program over process stdio with screen_options,
wraps it in an UncursesBackend, calls UncursesBackend::init, conditionally enters
the alternate screen, hides the cursor, records options.viewport in the
backend, and finally calls [Terminal::with_options].
§Parameters
options- terminal options from the widget library. The viewport is cloned before constructing the [Terminal] so the backend can mirror the same viewport behavior.screen_options- screen defaults controlling bracketed paste and mouse tracking.
§Returns
A ready-to-draw DefaultTerminal.
§Errors
Returns any error from opening stdio, screen initialization, alternate
screen entry, cursor hiding, or [Terminal::with_options].
§Panics
Does not intentionally panic.
§Usage note
[Viewport::Inline] stays on the main screen; all other viewports enter the
alternate screen before the terminal is returned. Always restore with
try_restore or restore after a successful setup.