Lsd: zsh default `lsd` alias conflict

Created on 21 May 2019  路  3Comments  路  Source: Peltoche/lsd

Hello,

zsh shell ships with a default configuration file that's placed in (generally) under /etc/zsh/zshrc and sourced on every session.

That includes an alias called lsd:
https://github.com/zsh-users/zsh/blob/master/StartupFiles/zshrc#L38

This conflicts with lsd binary and very hard to guess that it was the reason.

Expected behavior

lsd command should execute lsd binary

Actual behavior

lsd is an alias shipped with zsh installations to ls -d and does not execute lsd binary itself.

kinbug

Most helpful comment

unalias lsd # remove default alias
alias ls='lsd'

All 3 comments

Thanks a lot @cengizIO , this could explain a lot of stuff!

That said, on the go I don't have any solutions for you... Except maybe a good documentation, which is missing a the moment.

unalias lsd # remove default alias
alias ls='lsd'

Those StartupFiles from zsh are merely examples, meant to be referenced or copied and edited, and are not (should not) be sourced unless a user explicitly makes it happen. So this is not a "default alias" and this bug is invalid.

From the zsh readme:

Examples of zsh startup files are located in the subdirectory
StartupFiles.

From the referenced StartupFiles/zshrc:

#
# Example .zshrc file for zsh 4.0
#
# .zshrc is sourced in interactive shells.  It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#

# THIS FILE IS NOT INTENDED TO BE USED AS /etc/zshrc, NOR WITHOUT EDITING

If your distro's zsh package installs this such that it gets sourced by default, that is up to the distro, but is IMO a packaging bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EppO picture EppO  路  3Comments

meain picture meain  路  8Comments

saumyajyoti picture saumyajyoti  路  7Comments

alichtman picture alichtman  路  3Comments

Gerrit-K picture Gerrit-K  路  8Comments