Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Tag Archives: zsh

Startup Sequences of Shells

It is quite confusing if you need to work with multiple, so I make following tables.

zsh

From section STARTUP/SHUTDOWN FILES of man page zsh

Interactive Login Non-Interactive Login Interactive Non-Login Non-Interactive Non-Login
/etc/zshenv
$ZDOTDIR/.zshenv
/etc/zprofile
$ZDOTDIR/.zprofile
/etc/zshrc
$ZDOTDIR/.zshrc
/etc/zshrc
$ZDOTDIR/.zshrc
/etc/zlogin
$ZDOTDIR/.zlogin

bash

From section INVOCATION of man page bash

default

Interactive Login Non-Interactive Login Interactive Non-Login Non-Interactive Non-Login
/etc/profile

Then the first one that is readable amongst:

~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc
$BASH_ENV

bash as sh

Interactive Login Non-Interactive Login Interactive Non-Login Non-Interactive Non-Login
/etc/profile
~/.profile
$ENV
$ENV

tcsh

tcsh does not seem care the interactive mode when start up. if environment version has lf, then csh.login and ~/.login will run before csh.cshrc and ~/.tcshrc, respectively.
From section Startup and shutdown of man page tcsh

Login Non-Login
/etc/csh.cshrc
/etc/csh.login
First one that is readable amongst:

~/.tcshrc
~/.cshrc
~/.history
~/.login
~/.cshdirs
Advertisements

^A is shown when typing Ctrl-A zsh

zsh has a nasty/convenient behaviour: it will set vi binding for you if one of environment VISUAL or EDITOR has the command start with vi.

If you don’t like this, run bindkey -e to use the emac mode instead. Put it in your zshrc.

zsh: sequence of options matter.

I have been suggested that zsh is the ultimate shell that is ever needed. So I gave it a shot for months. At first, I was quite impressed of it’s completion on make targets, until I encountered two commands: rpm and yum, which were painfully slow.

I was looking for the script/hack/template that can speed up the rpm completion, but no prevail. I also wonder why nobody bother to fix it.

Today, I was going to give up zsh and turn to bash+ bash-completion, as that combination actually fit surprising good to my working style (but I still miss tcsh-like completion). Suddenly, I realize that sequence of options might be the key. So I try to use

rpm -ivh

instead of

rpm -hiv

which I always use.

And ta-da, it works.