Skip to content

Fix alternate/normal screen buffer switch for raw display - #556

Merged
penguinolog merged 1 commit into
urwid:masterfrom
AnonymouX47:fix-raw-display-buffer-switch
May 19, 2023
Merged

Fix alternate/normal screen buffer switch for raw display#556
penguinolog merged 1 commit into
urwid:masterfrom
AnonymouX47:fix-raw-display-buffer-switch

Conversation

@AnonymouX47

@AnonymouX47 AnonymouX47 commented May 18, 2023

Copy link
Copy Markdown
Contributor
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)
Description:

Fixes #487, #521

The XTerm Control Sequences documentation of both the Set and Reset of the 1049 DEC Private Mode (CSI ? 1049 h/l) state:

Use this with terminfo-based applications rather than the 47 mode.

This restores the normal screen buffer correctly on Xterm and Alacritty, both of which don't restore the normal buffer with CSI ? 47 l. Also, the 1049 mode should work just fine on virtually every [maintained] terminal emulator on which the 47 mode works.

- Fix: Switch terminal screen buffers for raw display using `1049` DEC
  Private Mode instead of DECSC/DECRC + `47` DEC Private Mode.

Fixes urwid#521
@oliver-sanders

Copy link
Copy Markdown

Thanks @AnonymouX47, I can confirm this fixes the issue in #521. Tested with MacOS/Terminal and Linux/XTerm.

@penguinolog
penguinolog merged commit 8330a89 into urwid:master May 19, 2023
@AnonymouX47
AnonymouX47 deleted the fix-raw-display-buffer-switch branch May 20, 2023 21:08
AnonymouX47 added a commit to AnonymouX47/termvisage that referenced this pull request May 21, 2024
- Change: Remove the workaround for urwid not properly switching to
  and from the alternate screen buffer.

Fixed in urwid
[v2.2.0](https://github.com/urwid/urwid/releases/tag/2.2.0) by
urwid/urwid#556.
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.

Terminal session not properly restored upon exit

3 participants