Open alexanderjeurissen opened 6 years ago
Hmm it seems that the code above does something, but only the GNU shell utilities respect it.
The first output is when explicitly using the GNU ls
command which is present in the coreutils homebrew package, the second output is bsd ls
The screenshot looks fine, the folders are colored. The only difference is that the BSD ls
seem to ignore the bold
attribute for them.
@arcticicestudio Not only that but it seems that the highlighting of dynamic links is also not working as expected in BSD ls
BSD ls
:
Core utils (GNU) ls
:
From what I've found in most issue reports and tutorials about getting dircolors set up for macOS it seems that BSD ls
can only be configured by setting the LSCOLORS
environment variable. The syntax differs from the LS_COLORS
env variable used for *nix-based OS. It's not nearly as comprehensive e.g. you can't do file-type matching.
It think the only common solution is to use GNU ls
(via alias) or try to build the theme for the LSCOLORS
env variable e.g. using a generator or build it manually.
@arcticicestudio I think you're right from what I've found it's not possible to have such detailed contextual highlighting using lscolors. For now I've aliased ls=\gls --color=always -G
Different question how did you manage to display the symbolic link target without the prefixed detailed file info chmod, username, last access date
(in the screenshot in the readme). As can be seen in my screenshot I use \gls -l
but that also displays aforementioned file details.
That's because you specified the -l
option which prints the output in a long listing format including all the details. If you run ls
without any option it will print only the file/folder names in a line without any information. To one name per line add -1
(number one, not the lowercase character L :smile: ), so the full command should be \gls -1
.
I'm not sure if the GNU core -utils package for macOS contains man
, but you can try to run man gls
to show the manpage which documents the command and all available options.
Reopened to improve the documentation by clarify that the project only works for GNU ls
. Refer macOS users to the LSCOLORS
environment variable documentation and link to a color scheme generator.
how can I use a color scheme generator to use the nord colors for osx? is there any easy way to do this sans manually configuring the colors?
The following worked for me:
coreutils
with homebrew
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
test -e ~/.dircolors && \
eval dircolors -b ~/.dircolors
4. start a new session.
Only the ignore pattern color doesn't work and the underscore when with the +t o+w permission.
EDIT 1: no alias with `--color=always` is being used. Plain `ls`.
EDIT 2: ignore patter color shows up outside tmux. Screenshoot is from inside tmux.
<img width="668" alt="Screen Shot 2019-07-10 at 0 15 12" src="https://user-images.githubusercontent.com/16728775/60900831-d64b2d80-a2a7-11e9-9c7b-09f380d51116.png">
@jmurinello Thank you for sharing your approach. But I still have to alias ls --color=always
in order to make ls
show colors when I use it outside of tmux.
@jmurinello What terminal app are you using? I followed your steps with iterm2 installed, but no coloring happens whatsoever. Any ideas?
My appologies for this late reply.
@shawnchan2014, I don't know if it's related but I'm using oh-my-zsh
framework.
@pimts, I'm using iTerm2 build 3.2.7. Other than that, prior to use nord-dircolors
I recall that my terminal didn't render italics and true color. This involves some configurations that I don't recall. Search for tmux italics
and you'll find many articles on the topic.
vivid has a working Nord theme
I need ls --color=auto
for it to work though
https://github.com/sharkdp/vivid
I just tried using this package and came to the realisation that dircolors only works on GNU e.g. Linux. and that MacOs uses LS colors https://gist.github.com/smutnyleszek/c44124908a9b737e372c28aaf0048b44
I found some instructions on how to get dircolors working by installing coreutils and adding the following code snippet to either bashrc or zshrc.
source: http://www.conrad.id.au/2013/07/making-mac-os-x-usable-part-1-terminal.html
I can verify that this will indeed change the
LS_COLORS
but the directory highlighting is still the same. Am I missing something ?I'm using Alacritty + Tmux + Zsh and have the respective Nord theme installed for all of them.