Skip to content
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

Use colors of the terminal theme. #165

Open
karambaq opened this issue Dec 5, 2017 · 11 comments
Open

Use colors of the terminal theme. #165

karambaq opened this issue Dec 5, 2017 · 11 comments

Comments

@karambaq
Copy link

karambaq commented Dec 5, 2017

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.

@athityakumar
Copy link
Owner

@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.

@karambaq
Copy link
Author

karambaq commented Dec 6, 2017

Here is the same folder:
image

@athityakumar
Copy link
Owner

@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?

@karambaq
Copy link
Author

karambaq commented Dec 8, 2017

@athityakumar
The second system:

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

First unfortunately is removed.

@benjamin-rood
Copy link

benjamin-rood commented Feb 3, 2018

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

@sbibauw
Copy link

sbibauw commented Feb 27, 2018

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

@msva
Copy link

msva commented Mar 24, 2018

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)

@harmnot
Copy link

harmnot commented Oct 24, 2018

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

@avdv
Copy link
Collaborator

avdv commented Oct 24, 2018 via email

@harmnot
Copy link

harmnot commented Oct 24, 2018

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

@natematykiewicz
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants