TerminalModeController

Mode-control contract for the terminal buffer.

These toggles affect how subsequent cursor motion and printable writes behave. They do not expose the underlying storage model to the parser.

Inheritors

Functions

Link copied to clipboard
abstract fun enterAltBuffer()

Switches to the alternate screen buffer with cursor save (CSI ? 1049 h).

Link copied to clipboard
abstract fun enterAltBufferWithoutCursorSave(clearBeforeEnter: Boolean)

Switches to the alternate screen buffer without saving the primary cursor state.

Link copied to clipboard
abstract fun exitAltBuffer()

Returns to the primary screen buffer with cursor restore (CSI ? 1049 l).

Link copied to clipboard

Returns to the primary screen buffer without restoring a saved cursor.

Link copied to clipboard
abstract fun popKittyKeyboardFlags(count: Int)

Pops the Kitty keyboard flags from the stack up to count times.

Link copied to clipboard
abstract fun pushKittyKeyboardFlags(flags: Int)

Pushes the current Kitty keyboard progressive-enhancement flags to the stack, and sets the new active flags.

Link copied to clipboard
abstract fun setApplicationCursorKeys(enabled: Boolean)

Toggles application cursor key mode (DECCKM, CSI ? 1 h / CSI ? 1 l).

Link copied to clipboard
abstract fun setApplicationKeypad(enabled: Boolean)

Toggles application keypad mode (DECNKM).

Link copied to clipboard
abstract fun setAutoWrap(enabled: Boolean)

Enables or disables DECAWM auto-wrap (CSI ? 7 h / CSI ? 7 l).

Link copied to clipboard
abstract fun setBellIsUrgent(enabled: Boolean)

Toggles urgent bell mode (?1042).

Link copied to clipboard
abstract fun setBracketedPasteEnabled(enabled: Boolean)

Enables or disables bracketed paste reporting (CSI ? 2004 h / CSI ? 2004 l).

Link copied to clipboard
abstract fun setCursorBlinking(enabled: Boolean)

Toggles cursor blink presentation state.

Link copied to clipboard

Sets the cursor shape/style.

Link copied to clipboard
abstract fun setCursorVisible(enabled: Boolean)

Toggles cursor visibility presentation state (DECTCEM, CSI ? 25 h / CSI ? 25 l).

Link copied to clipboard

Sets the default cursor shape/style restored on reset.

Link copied to clipboard
abstract fun setDynamicColor(target: Int, color: Int)

Updates a dynamic target color (foreground, background, or cursor color).

Link copied to clipboard
abstract fun setFocusReportingEnabled(enabled: Boolean)

Enables or disables focus in/out reporting (CSI ? 1004 h / CSI ? 1004 l).

Link copied to clipboard
abstract fun setFormatOtherKeysMode(mode: Int)

Sets the format-other-keys wire format used when modify-other-keys applies.

Link copied to clipboard
abstract fun setInsertMode(enabled: Boolean)

Enables or disables Insert Replace Mode (IRM, CSI 4 h / CSI 4 l).

Link copied to clipboard
abstract fun setKittyKeyboardFlags(flags: Int)

Sets active Kitty keyboard progressive-enhancement flags.

Link copied to clipboard
abstract fun setLeftRightMarginMode(enabled: Boolean)

Enables or disables left/right margin mode (DECLRMM, CSI ? 69 h / CSI ? 69 l).

Link copied to clipboard
abstract fun setModifyOtherKeysMode(mode: Int)

Sets the modify-other-keys reporting level.

Link copied to clipboard

Sets the active mouse report encoding mode used by terminal-to-host reporting.

Link copied to clipboard

Sets the active mouse tracking mode used by terminal-to-host reporting.

Link copied to clipboard
abstract fun setNewLineMode(enabled: Boolean)

Enables or disables New Line Mode (LNM, CSI 20 h / CSI 20 l).

Link copied to clipboard
abstract fun setOriginMode(enabled: Boolean)

Enables or disables Origin Mode (DECOM, CSI ? 6 h / CSI ? 6 l).

Link copied to clipboard
abstract fun setPaletteColor(index: Int, color: Int)

Updates an individual color index in the active 256-color palette.

Link copied to clipboard
abstract fun setPopOnBell(enabled: Boolean)

Toggles pop on bell mode (?1043).

Link copied to clipboard
abstract fun setReverseVideo(enabled: Boolean)

Toggles reverse-video presentation state (DECSCNM, CSI ? 5 h / CSI ? 5 l).

Link copied to clipboard
abstract fun setSynchronizedOutput(enabled: Boolean)

Toggles synchronized output mode (DECSET/DECRST ?2026).

Link copied to clipboard
abstract fun setThemePalette(palette: TerminalColorPalette)

Sets the theme-configured color palette for the terminal session.

Link copied to clipboard
abstract fun setTreatAmbiguousAsWide(enabled: Boolean)

Controls how East Asian Ambiguous codepoints are measured for future writes.