WSL word wrapping issue in small windows #10998

Closed
opened 2026-01-31 02:35:50 +00:00 by claunia · 4 comments
Owner

Originally created by @tomyummmm on GitHub (Oct 13, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.508]
Windows Terminal version (if applicable): 1.3.2651.0

Any other software? WSL Ubuntu-18.04

Steps to reproduce

  1. Open WSL and cd to a folder with a long path
  2. Resize window / split pane with duplicate until current path has word wrap on 3rd line.
  3. Do anything / enter / clear and see that word wrapping has glitched, causing multiple prints of the prompt.

Expected behavior

Only show 1 print of the prompt like CMD and Powershell

image

Actual behavior

Word wrapping past 2 lines in WSL causes the prompt to print and overlap twice. Should behave like CMD and PS

image
CMD on the left, PS in the middle, WSL on the right.

image
Word wrap 2 lines vs 3 lines

image
After typing and deleting command due to typo, the previous text remains on screen (cp_). Command still runs fine.

Originally created by @tomyummmm on GitHub (Oct 13, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19041.508] Windows Terminal version (if applicable): 1.3.2651.0 Any other software? WSL Ubuntu-18.04 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> 1. Open WSL and cd to a folder with a long path 2. Resize window / split pane with duplicate until current path has word wrap on 3rd line. 3. Do anything / enter / clear and see that word wrapping has glitched, causing multiple prints of the prompt. # Expected behavior Only show 1 print of the prompt like CMD and Powershell <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> ![image](https://user-images.githubusercontent.com/65211592/95833766-ad4cfe80-0d6e-11eb-8d4c-1f2fe2931043.png) # Actual behavior Word wrapping past 2 lines in WSL causes the prompt to print and overlap twice. Should behave like CMD and PS <!-- What's actually happening? --> ![image](https://user-images.githubusercontent.com/65211592/95833707-99a19800-0d6e-11eb-9a45-d24c891c62d4.png) CMD on the left, PS in the middle, WSL on the right. ![image](https://user-images.githubusercontent.com/65211592/95833800-bb9b1a80-0d6e-11eb-94ea-17863edb5adb.png) Word wrap 2 lines vs 3 lines ![image](https://user-images.githubusercontent.com/65211592/95834981-3e70a500-0d70-11eb-89ed-a47dab0cffad.png) After typing and deleting command due to typo, the previous text remains on screen (cp_). Command still runs fine.
claunia added the Resolution-Duplicate label 2026-01-31 02:35:50 +00:00
Author
Owner

@jdebp commented on GitHub (Oct 13, 2020):

Note that line editing libraries, like the GNU Readline that is linked into the Bourne Again shell, introduce complexities to what you are testing, as they attempt to redraw the edited line and sometimes the prompt when a terminal size change is signalled. Also note that it is possible to banjanx the Bourne Again shell's idea of what has been printed.

I suggest:

  • reproducing this without any control sequences at all in your PS1, neither colour changes nor stuff to set the window title, only a long directory name;
  • reproducing this with the Korn, Z, or even Almquist shells, all of which have different line editors and thus will demonstrate how much of this is peculiar to GNU Readline; and
  • showing what happens when the prompt is not the one for the current command line that is being input, i.e. what happens to a prompt that is not actively rewritten by your shell on size changes.
@jdebp commented on GitHub (Oct 13, 2020): Note that line editing libraries, like the GNU Readline that is linked into the Bourne Again shell, introduce complexities to what you are testing, as they attempt to redraw the edited line and sometimes the prompt when a terminal size change is signalled. Also note that [it is possible to banjanx the Bourne Again shell's idea of what has been printed](https://unix.stackexchange.com/a/317743/5132). I suggest: * reproducing this without _any_ control sequences _at all_ in your `PS1`, neither colour changes nor stuff to set the window title, _only_ a long directory name; * reproducing this with the Korn, Z, or even Almquist shells, all of which have _different_ line editors and thus will demonstrate how much of this is peculiar to GNU Readline; and * showing what happens when the prompt _is not_ the one for the current command line that is being input, i.e. what happens to a prompt that _is not_ actively rewritten by your shell on size changes.
Author
Owner

@tomyummmm commented on GitHub (Oct 13, 2020):

Note that line editing libraries, like the GNU Readline that is linked into the Bourne Again shell, introduce complexities to what you are testing, as they attempt to redraw the edited line and sometimes the prompt when a terminal size change is signalled. Also note that it is possible to banjanx the Bourne Again shell's idea of what has been printed.

I suggest:

* reproducing this without _any_ control sequences _at all_ in your `PS1`, neither colour changes nor stuff to set the window title, _only_ a long directory name;

* reproducing this with the Korn, Z, or even Almquist shells, all of which have _different_ line editors and thus will demonstrate how much of this is peculiar to GNU Readline; and

* showing what happens when the prompt _is not_ the one for the current command line that is being input, i.e. what happens to a prompt that _is not_ actively rewritten by your shell on size changes.

Sorry but I am not an advanced user of linux nor Terminal, so I have no clue what you are talking about at all. Just came across this issue and thought to report it.

@tomyummmm commented on GitHub (Oct 13, 2020): > > > Note that line editing libraries, like the GNU Readline that is linked into the Bourne Again shell, introduce complexities to what you are testing, as they attempt to redraw the edited line and sometimes the prompt when a terminal size change is signalled. Also note that [it is possible to banjanx the Bourne Again shell's idea of what has been printed](https://unix.stackexchange.com/a/317743/5132). > > I suggest: > > * reproducing this without _any_ control sequences _at all_ in your `PS1`, neither colour changes nor stuff to set the window title, _only_ a long directory name; > > * reproducing this with the Korn, Z, or even Almquist shells, all of which have _different_ line editors and thus will demonstrate how much of this is peculiar to GNU Readline; and > > * showing what happens when the prompt _is not_ the one for the current command line that is being input, i.e. what happens to a prompt that _is not_ actively rewritten by your shell on size changes. Sorry but I am not an advanced user of linux nor Terminal, so I have no clue what you are talking about at all. Just came across this issue and thought to report it.
Author
Owner

@zadjii-msft commented on GitHub (Oct 13, 2020):

For the record, this is actually already tracked over in #3088, or at least that's the issue I've been duping these issues to.

Thanks!

/dup #3088

@zadjii-msft commented on GitHub (Oct 13, 2020): For the record, this is actually already tracked over in #3088, or at least that's the issue I've been duping these issues to. Thanks! /dup #3088
Author
Owner

@ghost commented on GitHub (Oct 13, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Oct 13, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10998