Skip to content

VT emulator: missing DECAWM, DECOM, deferred wrap, REP support #365

Description

@Bahtya

Summary

The VT100/VT220 emulator in TerminalScreen is missing several important control sequence handlers used by TUI programs (ncurses, vim, etc.). These cause incorrect rendering and cursor positioning for full-screen terminal applications.

Missing Features

1. DECAWM - Auto-Wrap Mode (CSI ?7h / CSI ?7l)

DEC Private Mode 7 controls whether characters wrap to the next line at the right margin. TUI programs toggle this for precise line-end control.

  • File: screen.rs:564-589 - DecPrivateModeSet only handles 1049, 2004, 1000-1015. Mode 7 is missing.

2. DECOM - Origin Mode (CSI ?6h / CSI ?6l)

DEC Private Mode 6 controls whether CUP is relative to scroll region or screen origin. ncurses/vim use this for positioning within scroll regions.

3. Deferred Wrap (Wrap Pending)

When printing at the rightmost column, cursor should stay at last column with a "wrap pending" flag. The wrap occurs only on the next printable character.

Current: put_char() at screen.rs:851 immediately advances cursor.col past the last column. No wrap-pending flag exists.

4. REP - Repeat Character (CSI Ps b)

Repeats the previously printed character Ps times. Used for output optimization. CSI dispatch in emulator.rs does not handle b.

Priority

Important for correct TUI rendering but lower than the core ConPTY screen capture issue (#361).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions