Zsh

From XennisWiki
Jump to: navigation, search

The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting. Zsh is an extended Bourne shell with a large number of improvements, including some features of Bash, ksh, and tcsh. (Wikipedia)

Installation

Arch Linux

pacman -S zsh zsh-completions

Set as default shell: see chsh.

Debian

apt-get install zsh

oh-my-zsh

Installation

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Setup

Theme

Overview: Themes

To set the theme to "agnoster" install powerline fonts (Arch Linux: pacman -S powerline-fonts, Debian: apt-get install fonts-powerline) and set in the ~/.zshrc

ZSH_THEME="agnoster"

Hide username@host

Add to the ~/.zshrc

export DEFAULT_USER=<linux user name>

Errors and problems

corrupt history file

Error message
zsh: corrupt history file /home/myusername/.zsh_history
Solution
mv .zsh_history .zsh_history.bad
strings .zsh_history.bad > .zsh_history
fc -R .zsh_history

See also

External links