-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ls -s other-directory
wrong colors for directories
#15085
Comments
It's a known bug. |
Some words about why this issue is important to me: nushell seems like a nice language that I would enjoy using as my default shell environment. Since most commands don't produce structured output by default, I figured they would need to be wrapped in functions that switch them to a structured mode by default. Because colorized output is important to me, I started trying to figure out how to make custom commands emit colorized output (without ruining the actual file paths in case I later needed to work with them programmatically). Not finding any documentation about that, I tried to look into how the So for me, this bug is important for two big reasons:
Hopefully that's helpful as extra motivation for why this bug is important. And maybe that's all already obvious to y'all and the current implementation is just a placeholder for some grand vision that I haven't seen. Meta note: I was motivated to leave this comment because I didn't get the sense that it was viewed as an important problem and thought sharing my perspective would help. I intend it to be constructive, but would be interested in feedback if it doesn't come across as constructive |
Thanks for sharing. We're looking for motivated users to fix problems by submitting PRs as they have time. I've tried to fix this problem before and what it required was holding a String that was the file's path and a String that was used only for Display purposes. I figured that would be too heavy handed, so I never landed it. That closed PR is probably in this repo still as closed not implemented. There may be other ways to tackle it but I'm not sure what they are. |
This seems like it would be impossible if the only thing nushell has to work with is the shown string that gets printed. However that isn't all that's available. So the needed information is still there, just not within the one cell being shown. This is particularly noticible when using |
Go for it if you think you can make it work across Win, Lin, Mac. I'd love to see it. |
Describe the bug
when using
ls -s
to list the contents of other directories, the colors are wrong for subdirectoriesHow to reproduce
Expected behavior
When running
ls -s ../a
I expected the directory (b
) to be colored blue, and the file (b
) to be colored white, but the reverse was true.Configuration
The text was updated successfully, but these errors were encountered: