colorls icon indicating copy to clipboard operation
colorls copied to clipboard

Use colors of the terminal theme.

Open karambaq opened this issue 6 years ago • 11 comments

Description

I used colorls on other system, and it used the terminal colorscheme to display icons and etc Screenshot: tmux

And now I install on other laptop, same terminal colorscheme, same terminal emulator, but is used the other colors Screenshot: image

I haven't change nothing on the first system in the config, so maybe I can do that without set colors manual? Thank you.

karambaq avatar Dec 05 '17 19:12 karambaq

@karambaq - I don't see any inconsistency in your screenshots. The general color scheme (dark - see this file) provides

directory - blue recognized file format - green unrecognized file format- yellow

Simply, the two screenshots have different directory contents - hence, different colors. Let me know if I've missed out something.

athityakumar avatar Dec 06 '17 05:12 athityakumar

Here is the same folder: image

karambaq avatar Dec 06 '17 10:12 karambaq

@karambaq - Can you please specify the Ruby versions in both examples? I just faced this - one set of colors (Light-green) with 2.2.7 and another set of colors (Dark-green) with 2.4.2. Weird, maybe something is defined depending on RUBY_VERSION in the rainbow gem. Can you confirm if this is the reason?

athityakumar avatar Dec 08 '17 16:12 athityakumar

@athityakumar The second system:

ruby --version                                                                                                                                                                             
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]

First unfortunately is removed.

karambaq avatar Dec 08 '17 20:12 karambaq

Just my two cents: colorls has never used my term colour scheme. I thought that was a feature... Am I doing something wrong?

I'm using iTerm2 (Build 3.1.5) on macOS, and a mixture of things on Linux (at the moment it's alacritty).

iTerm2 examples:

Dark Background screen shot 2018-02-03 at 8 46 00 pm

Solarized Light screen shot 2018-02-03 at 8 46 29 pm

Cobalt Neon screen shot 2018-02-03 at 8 39 21 pm

Gruvbox screen shot 2018-02-03 at 8 18 52 pm

base16-grayscale-dark screen shot 2018-02-03 at 8 25 38 pm

Monotone screen shot 2018-02-03 at 8 39 09 pm

benjamin-rood avatar Feb 03 '18 06:02 benjamin-rood

If I can contribute to this discussion, I think colorls should, as default behavior, use ANSI color scheme (= Terminal colors) rather than a fixed set of X11 colors.

Meanwhile, I achieved this by following the README custom configuration recommendations:

cp $(dirname $(gem which colorls))/yaml/dark_colors.yaml ~/.config/colorls/dark_colors.yaml

And customizing ~/.config/colorls/dark_colors.yaml with mostly ANSI colors (and X11 gray variations for dimming effects -- but that could very well be replaced by ANSI colors) (feel free to use it and adapt it to your needs):

# Main Colors
unrecognized_file: lightgray
recognized_file:   white
dir:               blue

# Link
dead_link: red
link:      magenta

# Access Modes
write:     yellow
read:      gray
exec:      red
no_access: dimgray

# Age
day_old:     lightgray
hour_old:    white
no_modifier: darkgray

# File Size
file_large:  white
file_medium: lightgray
file_small:  darkgray

# Random
report: white
user:   cyan
tree:   dimgray
empty:  yellow
error:  red
normal: darkgray

# Git
addition:     green
modification: yellow
deletion:     red
untracked:    darkgray
unchanged:    white

screenshot of colorls --tree

sbibauw avatar Feb 27 '18 15:02 sbibauw

well, the real issue, as far as I understand TS (and it is also what I am missing very much) is that colorls doesn't obey LS_COLORS, and uses it's own "themes". Also, as second sub-issue, it is impossible (as far as I can see) to set terminal text "effects" like bold, underline, italic, reverse and so on in that custom "themes".

So, since LS_COLORS is already used by ls and have the support for the effects, it will be much more useful to:

  1. support it
  2. use it instead of custom "themes"

Well, actually, there is nothing about git-things in dircolors (which is often used to populate LS_COLORS) source format, as well, as there is nothing about it documented in LS_COLORS format itself, but, anyway, I think the problem is solvable anyway.

Or at least, it will be nice that "themes" at least support something like that:

all: ls_colors
# ^ which would use LS_COLORS content (which already has SHELL-compatible definitions for filetypes (normal, dev-node, symlink, hardlink, broken link and so on) as well as for file extensions)) for al the types that isn't explicitly defined here

# Git
addition:     [chartreuse,bold]
modification: [darkkhaki,underline]
deletion:     [darkred,italic]
untracked:    [darkorange,reverse]
unchanged:    [forestgreen,blink]

# ^ explicitly defined types

(well there is other ANSI text effects existing, and as far as I see, rainbow gem do support them). And it will also be cool that theming engine (wrapper around rainbow) doesn't force to use ANSI/X11 color names, but also allow hex-rgb colors, and also ANSI codes (like in LS_COLORS too)

msva avatar Mar 24 '18 20:03 msva

about cp $(dirname $(gem which colorls))/yaml/dark_colors.yaml ~/.config/colorls/dark_colors.yaml

is this run. on terminal or add on ~/.zshrc ???

I tried to find file ~/.config/colors, but not found

harmnot avatar Oct 24 '18 13:10 harmnot

Just create that directory first if it does not exist. Then, run the command once in your shell.

HTH

On October 24, 2018 3:30:41 PM GMT+02:00, harmnot [email protected] wrote:

about cp $(dirname $(gem which colorls))/yaml/dark_colors.yaml ~/.config/colorls/dark_colors.yaml

is this run. on terminal or add on ~/.zshrc ???

I tried to find file ~/.config/colors, but not found

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/athityakumar/colorls/issues/165#issuecomment-432656642

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

avdv avatar Oct 24 '18 14:10 avdv

by the way I got error on terminal no such file or directory: /tab_complete.sh on my. file .zshrc ? but my colonels worked

harmnot avatar Oct 24 '18 14:10 harmnot

I didn't realize that you could use those ANSI color names and it would follow the terminal theme. Thank you for that @sbibauw!

@msva To your point, yeah it would be great if I could also use the modifiers, such as making some things ANSI "bright blue" (which I wanted to do).

natematykiewicz avatar Sep 12 '19 15:09 natematykiewicz