Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Windows VT mode, and ALTSCREEN support #692

Merged
merged 6 commits into from
Mar 2, 2024
Merged

Conversation

gdamore
Copy link
Owner

@gdamore gdamore commented Mar 2, 2024

This enables the use of VT mode on Windows by default everywhere except ConEmu (because ConEmu is too broken). The attempt to use (or not use) the vt mode can be controlled by the TCELL_VTMODE environment variable (set it to "enable" or "disable" -- default is enabled unless ConEmu is detected.)

This also uses the alternate screen buffer on Windows by default, with fixes to avoid clearing the non-alternate screen.

It also adds TCELL_ALTSCREEN as an override. This can be set to "disable" (on either Windows or POSIX), in which case we won't use the alternate screen. We also don't clear the screen on exit (or disengage) in that case, and the cursor may be at an indeterminate location. Applications may utilize this to arrange for Tcell to draw the screen, then drop to some other application (e.g. using GNU readline or something) while leaving the part drawn by tcell present. This is highly experimental, and I'm not formally documenting it yet because its likely brittle and may change in the future. It also doesn't work with every terminal type.

The special environment variable TCELL_VTMODE may be set to "disable"
to return to legacy console mode.  (This environment variable may
be removed in the future, if we determine it is no longer useful.)
…ble)

The alternate screen buffer right now only works in VT mode.
This hack will also prevent the clearing of the screen at disengage
time.  This may be useful for certain kinds of applications that
want to draw the screen, then place the cursor at a specific location.
(The application will need to do a TGoto on it's own first.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant