dircolors with background color set highlights to end of line #10242

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

Originally created by @zedtools on GitHub (Aug 21, 2020).

Environment

Windows build number: 10.0.19041.450
Windows Terminal version 1.2.2234.0

Any other software? No

Steps to reproduce

I am using zsh on WSL Ubuntu.

Put the following in ~/.dircolors:
OTHER_WRITABLE 30;42

Then run:
eval $( dircolors -b $HOME/.dircolors )

Finally, fill up the terminal screen (e.g. pressing ENTER repeatedly) so that prompt is at the bottom of the window, and run:
ls -l

Expected behavior

When running ls -l to view a writable directory, the directory name should be highlighted.

Actual behavior

If the highlighted directory name spans across a newline, and the ls output scrolls past the bottom of the window, then the entire second line is highlighted.

See screenshot below. The second ls -l caused the terminal to scroll past the bottom of the window, and long_dir_name is incorrectly highlighted.

image

Originally created by @zedtools on GitHub (Aug 21, 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: 10.0.19041.450 Windows Terminal version 1.2.2234.0 Any other software? No ``` # Steps to reproduce I am using zsh on WSL Ubuntu. Put the following in ~/.dircolors: `OTHER_WRITABLE 30;42` Then run: `eval $( dircolors -b $HOME/.dircolors )` Finally, fill up the terminal screen (e.g. pressing ENTER repeatedly) so that prompt is at the bottom of the window, and run: `ls -l` <!-- A description of how to trigger this bug. --> # Expected behavior When running `ls -l` to view a writable directory, the directory name should be highlighted. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior If the highlighted directory name spans across a newline, and the ls output scrolls past the bottom of the window, then the entire second line is highlighted. See screenshot below. The second `ls -l` caused the terminal to scroll past the bottom of the window, and long_dir_name is incorrectly highlighted. ![image](https://user-images.githubusercontent.com/30283145/90845855-47fe1200-e3aa-11ea-9f65-4c8d2fb278ac.png) <!-- What's actually happening? -->
Author
Owner

@zadjii-msft commented on GitHub (Aug 21, 2020):

You know, I thought this was #3848, but this doesn't have anything to do with resizing, so this might not actually be that. And it's not #32 either, because again, there's no resizing happening.

I'm not totally sure what's happening here. I'll toss this on the v2 milestone to figure out. Thanks! (I'm tentatively tossing this on Product-Terminal, but this is probably Product-Conhost)

@zadjii-msft commented on GitHub (Aug 21, 2020): You know, I _thought_ this was #3848, but this doesn't have anything to do with resizing, so this might not actually be that. And it's not #32 either, because again, there's no resizing happening. I'm not totally sure what's happening here. I'll toss this on the v2 milestone to figure out. Thanks! (I'm tentatively tossing this on Product-Terminal, but this is probably Product-Conhost)
Author
Owner

@j4james commented on GitHub (Aug 21, 2020):

I believe this is working as intended. If the background color is set when the screen scrolls (which is what is happening here), then the newly revealed line is filled with that background color. I think you'll find the same behaviour on all terminals that support background color erase.

@j4james commented on GitHub (Aug 21, 2020): I believe this is working as intended. If the background color is set when the screen scrolls (which is what is happening here), then the newly revealed line is filled with that background color. I think you'll find the same behaviour on all terminals that support background color erase.
Author
Owner

@zedtools commented on GitHub (Aug 22, 2020):

Hmm... I just tried this with mintty on Windows, and iTerm2 on MacOS. Both of them behave the same as above, so you may be correct.

Resizing the window is different. If i resize iTerm2, the background colour stays unchanged. If I resize Windows Terminal, the background colour is fixed so that it is not highlighted to the end of the line. It's a minor inconsistency, though I am not sure which behaviour is correct.

Based on this, I am happy to leave the current behaviour unchanged.

@zedtools commented on GitHub (Aug 22, 2020): Hmm... I just tried this with mintty on Windows, and iTerm2 on MacOS. Both of them behave the same as above, so you may be correct. Resizing the window is different. If i resize iTerm2, the background colour stays unchanged. If I resize Windows Terminal, the background colour is fixed so that it is not highlighted to the end of the line. It's a minor inconsistency, though I am not sure which behaviour is correct. Based on this, I am happy to leave the current behaviour unchanged.
Author
Owner

@zadjii-msft commented on GitHub (Aug 24, 2020):

Oh, okay, thanks for the follow up! I guess I triaged this without even checking other terminals 😅

As far as the color highlighting till the end of the line issue, that'll be #32.

Thanks!

@zadjii-msft commented on GitHub (Aug 24, 2020): Oh, okay, thanks for the follow up! I guess I triaged this without even checking other terminals 😅 As far as the color highlighting till the end of the line issue, that'll be #32. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10242