colorls
colorls copied to clipboard
Make trailing directory backslash optional
Description
I'd like trailing directory backslashes to be optional. I've done it manually on my local machine, and IMO it looks cleaner (esp when listing a directory with many subdirectories).
It looks like:

At the moment a space is conjoined to the end of file paths and a slash is conjoined to directory paths. I was thinking a flag could be used to make them uniform, or something similar.
This is strictly speaking a duplicate, since it's been asked for in the cited issue. I'm not fussed about the other elements of that request, though, just the backslashes.
I'd be happy to give it a go if deemed valuable.
- Relevant Issues : #344
- Relevant PRs : (none)
- Type of issue :
- [ ] Installation
- [ ] Font-related
- [x] Feature request
- [ ] Bug in existing feature
- [ ] Developer mode : Code quality / Tests / Documentation
As a test, I added the option --trailing-backslash
to hide trailing directory backslash.
Is this like what you want to do?
Yeah that's the idea! Nice one! 👍
GNU ls (and scalals :smile:) has these options:
--indicator-style STYLE append indicator with style WORD to entry names: none (default), slash (-p), file-type (--file-type), classify (-F)
-p, --indicator-style=slash
append / indicator to directories
colorls should support these too, but probably use slash
as the default for backward compat
colorls should support these too, but probably use
slash
as the default for backward compat
I think so, too.
I'm thinking of adding --indicator-style
option. Unlike the original ls
command, the default value will be not
none
, but slash
.
I added --indicator-style
option. How is this?
Trailing directory backslash is hidden , only when none
is set to --indicator-style
option.
Yeah perfect @t-mangoe! Thanks a bunch ❤️
Thank you for good comment!!
I'm thinking of adding tests for this option, --indicator-style
, then sending pull request.
Maybe, it may take time for me to do this. I'm happy if you wait patiently.
I sent a pull request about this issue.