Skip to content

tui: S8C1T (8-bit) mode, v:termresponse #6279

Open

Description

Problem

#25856 implemented v:termresponse but we don't yet use it to detect whether we can use 8-bit key sequences.

Related Vim help:

>       >       >       >       >       >       xterm-8bit xterm-8-bit
Xterm can be run in a mode where it uses 8-bit escape sequences.  The CSI code
is used instead of <Esc>[.  The advantage is that an <Esc> can quickly be
recognized in Insert mode, because it can't be confused with the start of a
special key.
For the builtin termcap entries, Vim checks if the 'term' option contains
"8bit" anywhere.  It then uses 8-bit characters for the termcap entries, the
mouse and a few other things.  You would normally set $TERM in your shell to
"xterm-8bit" and Vim picks this up and adjusts to the 8-bit setting
automatically.
When Vim receives a response to the t_RV (request version) sequence and it
starts with CSI, it assumes that the terminal is in 8-bit mode and will
convert all key sequences to their 8-bit variants.

Expected behavior

Nvim should detect whether it can use 8-bit mode, via a "request version" TermResponse (aka "Primary Device Attributes"?). Unless there's a better way.

Reference

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions