Posts

Showing posts with the label zsh

read command in zsh throws error

If you want emulate pause command in your shell, read is the most used command. In bash works without problems: read -p $'Press enter to continue...\n' ... but in zsh the argument -p is for coprocess, for that reason returns: read: -p: no coprocess To have a generic code to emulate pause command (independent of your shell), is better use the following sentence: printf 'Press enter to continue...\n';read ans Enjoy it!

Improve your terminal with suggestions from your history with zsh

Image
If you want enable command prediction on your terminal, a good option is to install zsh. sudo apt-get install zsh  Now, replace bash by zsh with the following instruction: USER=`whoami` chsh -s /bin/zsh $USER Now, install Oh My Zsh: sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" And finally install Fish-like autosuggestions for zsh: git clone http://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions Edit your ~/.zshrc file and add zsh-autosuggestions as a plugin: plugins=(git zsh-autosuggestions) If you like, you can change your terminal theme. I like cobalt2: git clone https://github.com/powerline/fonts.git cd fonts ./install.sh cd .. git clone https://github.com/wesbos/Cobalt2-iterm.git cd Cobalt2-iterm  mv cobalt2.zsh-theme ~/.oh-my-zsh/themes  vim ~/.zshrc  ZSH_THEME="cobalt2" Now, we can restart zshell with the following comm...