Terminal shows previous mangled buffer text when scrolling up after a resize action #20935

Closed
opened 2026-01-31 07:28:16 +00:00 by claunia · 2 comments
Owner

Originally created by @AmerM137 on GitHub (Dec 1, 2023).

Windows Terminal version

1.18.3181.0

Windows build number

10.0.19045.3693

Other Software

micro text editor 2.0.13 -- https://github.com/zyedidia/micro
nano for windows 7.2-22.1 -- https://github.com/okibcn/nano-for-windows
Capture

Steps to reproduce

Scrollbar visibility == Hidden, History size == 9001
Launch windows terminal, launch micro text editor. Write a few lines, resize terminal (larger->smaller or smaller->larger). Resizing unlocks ability to scroll up using keyboard bindings or using mouse select. Previous buffer shows with characters jumbled up / misaligned.

Same issue using windows terminal with nano editor.
Same issue using wezterm with both micro and nano.
Same issue using alacritty with both micro and nano.
Tested with nvim. No issue with nvim on all terminal emulators (cannot scroll back after resizing). This should be actual behavior for all editors.

Expected Behavior

Text should be redrawn normally and inability to scroll back should be maintained.

Actual Behavior

Resizing "unlocks" scrolling again, causing previous ghost text/buffers to show up. Particularly annoying when trying to drag-select with the mouse near the top of the file. Very confusing when seeing the previous buffers, especially when the text is all misaligned.

Originally created by @AmerM137 on GitHub (Dec 1, 2023). ### Windows Terminal version 1.18.3181.0 ### Windows build number 10.0.19045.3693 ### Other Software micro text editor 2.0.13 -- https://github.com/zyedidia/micro nano for windows 7.2-22.1 -- https://github.com/okibcn/nano-for-windows ![Capture](https://github.com/microsoft/terminal/assets/37887075/709b6388-2c09-4f67-afd6-1f3f6d779cd7) ### Steps to reproduce Scrollbar visibility == Hidden, History size == 9001 Launch windows terminal, launch micro text editor. Write a few lines, resize terminal (larger->smaller or smaller->larger). Resizing unlocks ability to scroll up using keyboard bindings or using mouse select. Previous buffer shows with characters jumbled up / misaligned. Same issue using windows terminal with nano editor. Same issue using wezterm with both micro and nano. Same issue using alacritty with both micro and nano. Tested with nvim. **No issue with nvim on all terminal emulators** (cannot scroll back after resizing). This should be actual behavior for all editors. ### Expected Behavior Text should be redrawn normally and inability to scroll back should be maintained. ### Actual Behavior Resizing "unlocks" scrolling again, causing previous ghost text/buffers to show up. Particularly annoying when trying to drag-select with the mouse near the top of the file. Very confusing when seeing the previous buffers, especially when the text is all misaligned.
claunia added the Needs-TriageIssue-BugResolution-External labels 2026-01-31 07:28:17 +00:00
Author
Owner

@DHowett commented on GitHub (Dec 2, 2023):

(I'm about to leave for the day, so just dropping some notes in here.)

This typically happens when a text editor is not properly using the "Xterm Alternate Screen Buffer". That's a mode that (1) restricts all scrolling and (2) ensures that nothing on the screen gets put into the scrollback buffer.

I wonder if applications are not aware that it exists on Windows, or perhaps their language runtimes don't allow them to use it.

@DHowett commented on GitHub (Dec 2, 2023): (I'm about to leave for the day, so just dropping some notes in here.) This typically happens when a text editor is not properly using the "Xterm Alternate Screen Buffer". That's a mode that (1) restricts all scrolling and (2) ensures that nothing on the screen gets put into the scrollback buffer. I wonder if applications are not aware that it exists on Windows, or perhaps their language runtimes don't allow them to use it.
Author
Owner

@carlos-zamora commented on GitHub (Dec 13, 2023):

Thanks for filing! Looks like this is being handled over in https://github.com/zyedidia/micro/issues/3073 so I'm going to close this as external.

@carlos-zamora commented on GitHub (Dec 13, 2023): Thanks for filing! Looks like this is being handled over in https://github.com/zyedidia/micro/issues/3073 so I'm going to close this as external.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20935