Skip to content

Modern Tui TuiTerminal Enter

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Terminal › TuiTerminal.Enter

TuiTerminal.Enter

Takes over the terminal with the options asked for; fails if output is not a terminal.

Syntax

TuiTerminal.Enter( byval opts as TuiTermOptions ) as TuiUnitResult

Description

Takes the terminal: alternate screen, raw mode, cursor, mouse, bracketed paste, focus events -- whichever the options ask for. Fails with TUIERR_NOTATTY when stdout is not a terminal, which is the check that stops a dashboard being drawn into a pipe. Calling it twice is a no-op, not an error.

Example

#import "std/tui"
using tui

dim as TuiTerminal term
dim as TuiTermOptions o = TuiTermOptionsDefault( )
o.mouse = TRUE

dim as TuiUnitResult r = term.Enter( o )
if( r.IsOk( ) = false ) then
    '' under a test harness or a pipe this is the branch that runs
    print r.Failure( ).code = TUIERR_NOTATTY
end if

See also

TuiTerminal TuiTerminal.Size TuiTerminal.Write TuiTerminal.Discard
TuiTerminal.Leave TuiTerminal.Caps TuiTerminal.WriteText TuiTerminal.Pending
TuiTerminal.IsActive TuiTerminal.DetectCaps TuiTerminal.Flush TuiTerminal.TakeResize

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Terminal
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally