TrueNAS LS unreadable

Hi, I’m hoping this is an easy one. I’ve SSHd into a fresh truenas but the LS command output is mostly unreadable, see screenshot below. I can’t fathom why such an illegible colour scheme is used as the default?

First questions of course is how do I change it to something readable, but my follow up is why do I need to this seems like a pretty obvious bad design?

You would have to ask the developer of your terminal emulator on why they chose those colours. Check the settings of your terminal emulator on how to change the colours, or choose a different terminal emulator.

That would be all of them then because it’s the same in every terminal I try

Here’s how it looks with different terminal colours:

You can say that “blue in green background” is not the best choice, but terminal emulators were limited to like 16 colours.

What terminal emulator are you using? Many have some colour theme options available.

You can also customize the colours that ls uses. For example you can put something like this into your .bashrc:

And TrueNAS doesn’t do anything to change the defaults for ls or other relevant commands:

truenas_admin@nas2[~]$ alias
g='egrep -i'
h='fc -l'
j=jobs
l='ls -l'
ll='ls -laFo'
m=''
which-command=whence
truenas_admin@nas2[~]$ export
DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/950/bus'
HOME=/home/truenas_admin
HUSHLOGIN=FALSE
LANG=en_US.UTF-8
LC_ALL=C.UTF-8
LOGNAME=truenas_admin
MAIL=/var/mail/truenas_admin
MOTD_SHOWN=pam
OLDPWD=/home/truenas_admin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/home/truenas_admin
SHELL=/usr/bin/zsh
SHLVL=1
TERM=xterm
USER=truenas_admin
XDG_RUNTIME_DIR=/run/user/950
XDG_SESSION_CLASS=user
XDG_SESSION_ID=2378
XDG_SESSION_TYPE=tty
truenas_admin@nas2[~]$ 

Agreed, it’s pretty much a normal debian install. The truenas_admin user is “unusual” because it uses the zsh shell (probably due to TrueNAS having its roots in FreeBSD).

When using the bash shell, it does set the ls color option.

$ alias
alias ls='ls --color=auto'

Which is also another option you have: you can remove colors from ls if you remove the alias (comment the line in .bashrc).

Neither zsh nor the truenas_admin user have anything in particular to do with FreeBSD, and zsh is the default shell for other users as well, if you give them shell access at all–it’s just a nicer shell all-around than bash. But of course you can change that (for the admin or any other user) to bash, dash, rbash, sh, tmux, or the TrueNAS CLI or console.

OP, there’s nothing at all TrueNAS-specific about this–it’s using whatever the default is under zsh. You’d change it the same way you would for any other zsh installation, or change to a different shell if you prefer.

For most linux distributions, bash is the default shell. Of course it is up to user preferences and can be changed.

*BSD (for example FreeBSD) is different. Bash can be used there but it is not the default. If you want to go further you can also go into license “purity” territory, Bash is GPL licensed which some BSD do not like.

The fact that root and truenas_admin users use zsh as the shell is uncommon in debian. That is a deliberate choice made by the TrueNAS developers.

Of course, this doesn’t matter at all to the issue of OP. OP is likely using bash (because the default bash profile enables coloured ls output).

Well theming alacritty has at least helped but i’m still struggling to understand who thought this colour scheme would ever work for anything, and why nobody has thought to maybe change the default to be more friendly so that theming your terminal emulator isn’t required to use the colour output, or perhaps just not having the colour output on by default if we can’t be bothered to make it useable.

Regardless, I’ll be getting used to cyberpunk neon alacritty, appreciate everyones help and input :slight_smile:

If OP is using bash, it’s because a deliberate change has been made; zsh is the default shell. And its default configuration also results in colored output to ls.

I haven’t seen that behaviour in any TrueNAS version I tested. Which version of TrueNAS are you using? In your output provided previously there is no alias for ls.
For bash there is /etc/skel/.bashrc which provides the defaults:

$ grep alias /etc/skel/.bashrc
# enable color support of ls and also add handy aliases
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'

I checked /etc/skel and /etc/zsh and could not find any alias configuration for ls. And I cannot reproduce the behavior you are describing with the built-in truenas_admin user.