colorls icon indicating copy to clipboard operation
colorls copied to clipboard

Make trailing directory backslash optional

Open niallpaterson opened this issue 4 years ago • 8 comments

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:

Screenshot 2020-08-19 at 21 19 01

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

niallpaterson avatar Aug 19 '20 20:08 niallpaterson

As a test, I added the option --trailing-backslash to hide trailing directory backslash. Is this like what you want to do? スクリーンショット 2021-05-03 9 43 58

t-mangoe avatar May 03 '21 00:05 t-mangoe

Yeah that's the idea! Nice one! 👍

niallpaterson avatar May 04 '21 08:05 niallpaterson

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

avdv avatar May 04 '21 13:05 avdv

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.

t-mangoe avatar May 08 '21 00:05 t-mangoe

I added --indicator-style option. How is this? Trailing directory backslash is hidden , only when none is set to --indicator-style option. スクリーンショット 2021-05-08 17 13 36

t-mangoe avatar May 08 '21 08:05 t-mangoe

Yeah perfect @t-mangoe! Thanks a bunch ❤️

niallpaterson avatar May 11 '21 14:05 niallpaterson

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.

t-mangoe avatar May 15 '21 01:05 t-mangoe

I sent a pull request about this issue.

t-mangoe avatar May 22 '21 00:05 t-mangoe