incorrect alignment of name in ls in wsl2 in windows terminal, but correct in windows wsl console #6496

Closed
opened 2026-01-31 00:40:17 +00:00 by claunia · 10 comments
Owner

Originally created by @souradeep100 on GitHub (Feb 17, 2020).

Environment

Windows 10 version 2004 (build 19041.84)

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):
Version: 0.9.433.0
Any other software?
oh-my-zsh
➜  test echo $ZSH_VERSION
5.4.2

WSL2
font cascadia code
from profiles:
"colorScheme": "Dracula",
"fontFace": "Cascadia code",
"fontSize": 12,
"cursorShape": "filledBox"

Steps to reproduce

create more good number of files in a directory and the last file name of the dir aligns incorrectly.

Like following:
➜ test ls
abcd abcd1 abcd10 abcd2 abcd3 abcd4 abcd5 abcd6 abcd7 abcd8 abcd9 one_abcd_ one_abcd_1 one_abcd_2 one_abcd_3 one_abcd_4 one_abcd_5 one_abcd_6

create more good number of files in a directory and the last file name of the dir aligns incorrectly.

Like following:
➜ test ls
abcd abcd1 abcd10 abcd2 abcd3 abcd4 abcd5 abcd6 abcd7 abcd8 abcd9 one_abcd_ one_abcd_1 one_abcd_2 one_abcd_3 one_abcd_4 one_abcd_5 one_abcd_6

Expected behavior

from windows console:
➜ ~ cd test ➜ test ls abcd abcd10 abcd3 abcd5 abcd7 abcd9 one_abcd_1 one_abcd_3 one_abcd_5 abcd1 abcd2 abcd4 abcd6 abcd8 one_abcd_ one_abcd_2 one_abcd_4 one_abcd_6

Actual behavior

Originally created by @souradeep100 on GitHub (Feb 17, 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 Windows 10 version 2004 (build 19041.84) ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] Windows Terminal version (if applicable): Version: 0.9.433.0 Any other software? oh-my-zsh ➜ test echo $ZSH_VERSION 5.4.2 ``` WSL2 font cascadia code from profiles: "colorScheme": "Dracula", "fontFace": "Cascadia code", "fontSize": 12, "cursorShape": "filledBox" # Steps to reproduce create more good number of files in a directory and the last file name of the dir aligns incorrectly. Like following: ➜ test ls abcd abcd1 abcd10 abcd2 abcd3 abcd4 abcd5 abcd6 abcd7 abcd8 abcd9 one_abcd_ one_abcd_1 one_abcd_2 one_abcd_3 one_abcd_4 one_abcd_5 one_abcd_6 <!-- A description of how to trigger this bug. --> create more good number of files in a directory and the last file name of the dir aligns incorrectly. Like following: ➜ test ls abcd abcd1 abcd10 abcd2 abcd3 abcd4 abcd5 abcd6 abcd7 abcd8 abcd9 one_abcd_ one_abcd_1 one_abcd_2 one_abcd_3 one_abcd_4 one_abcd_5 one_abcd_6 # Expected behavior from windows console: ➜ ~ cd test ➜ test ls abcd abcd10 abcd3 abcd5 abcd7 abcd9 one_abcd_1 one_abcd_3 one_abcd_5 abcd1 abcd2 abcd4 abcd6 abcd8 one_abcd_ one_abcd_2 one_abcd_4 one_abcd_6 <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior <!-- What's actually happening? -->
Author
Owner

@souradeep100 commented on GitHub (Feb 17, 2020):

Capture

@souradeep100 commented on GitHub (Feb 17, 2020): ![Capture](https://user-images.githubusercontent.com/11392837/74682471-28641200-51ec-11ea-843b-ba8bf3fab599.PNG)
Author
Owner

@souradeep100 commented on GitHub (Feb 17, 2020):

Also the PS1:

➜  test echo $PS1
%(?:%{%}➜ :%{%}➜ ) %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)
@souradeep100 commented on GitHub (Feb 17, 2020): Also the PS1: ``` ➜ test echo $PS1 %(?:%{%}➜ :%{%}➜ ) %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info) ```
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 21, 2020):

Does this only happen after you resize the terminal? Or can you reproduce this by running ls without resizing it?

@DHowett-MSFT commented on GitHub (Feb 21, 2020): Does this only happen after you resize the terminal? Or can you reproduce this by running `ls` without resizing it?
Author
Owner

@souradeep100 commented on GitHub (Feb 24, 2020):

No it happens by default. I don't have to do any resizing. It happens only on maximized window which is default size. But when I do restore down button, in that mini scaled window the problem does not happen.

@souradeep100 commented on GitHub (Feb 24, 2020): No it happens by default. I don't have to do any resizing. It happens only on maximized window which is default size. But when I do restore down button, in that mini scaled window the problem does not happen.
Author
Owner

@souradeep100 commented on GitHub (Feb 24, 2020):

image

@souradeep100 commented on GitHub (Feb 24, 2020): ![image](https://user-images.githubusercontent.com/11392837/75180803-f100e280-5762-11ea-84fa-2c9910c51566.png)
Author
Owner

@souradeep100 commented on GitHub (Feb 24, 2020):

see the o in the last "ls" output . Shared the PS1 details as well.

@souradeep100 commented on GitHub (Feb 24, 2020): see the o in the last "ls" output . Shared the PS1 details as well.
Author
Owner

@souradeep100 commented on GitHub (Feb 24, 2020):

The oh-my-zsh theme was "robbyrussell". No changes done on theme.

@souradeep100 commented on GitHub (Feb 24, 2020): The oh-my-zsh theme was "robbyrussell". No changes done on theme.
Author
Owner

@jdebp commented on GitHub (Mar 2, 2020):

In colour mode, GNU ls uses EL 0 after every last-column filename. In all modes, it then uses TAB/SPC to align to the start of the next column followed by LF after the final column. souradeep100, you can help the Microsoft people narrow the potential locus of the problem by eliminating all use of colour (and hence EL 0) by GNU ls, with --colour=none.

@jdebp commented on GitHub (Mar 2, 2020): [In colour mode, GNU `ls` uses EL 0 after every last-column filename](https://github.com/coreutils/coreutils/blob/05a99f7d7f8e0999994b760bb6337ca10ea0a14b/src/ls.c#L4766). In all modes, it then uses TAB/SPC to align to the start of the next column followed by LF after the final column. souradeep100, you can help the Microsoft people narrow the potential locus of the problem by eliminating all use of colour (and hence EL 0) by GNU `ls`, with `--colour=none`.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 27, 2020):

That would be very helpful. I’ll mark this one for author feedback. Thanks!

@DHowett-MSFT commented on GitHub (Mar 27, 2020): That would be very helpful. I’ll mark this one for author feedback. Thanks!
Author
Owner

@ghost commented on GitHub (Mar 31, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Mar 31, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6496