Photos and other rants

Meny Stäng

Etikett: bash

Configure zsh in Byobu

Most Linuxen these days runs bash as their native shell. While Bash is OK it’s not my favourite actually. I’ve always been partial to zsh which for example has outstanding completion qualities that Bash totally misses.

If you run byobu which is an add-on for tmux or screen with lots of nifty features then you should perhaps want to configure it for zsh as it’s standard shell.

This works if you are using tmux rather than screen as your terminal multiplexer.

It’s easy if you know what to do. So open an editor and edit the file:


Then enter the following:

set -g default-shell /bin/zsh
set -g default-command /bin/zsh

Save the file, restart your byobu and everything should be daddy-o.



My Bash bases photo album generator Albatross is back by popular demand. If you are hacking your own version I’d be happy to integrate it with the base code.


Your favourite prompt

Today’s Bash tip. Create a prompt that changes face depending on the return code of your last command. As long as the return code is OK you get a happy face. When it is false you get a sad one.

Open and edit the .bashrc file in your home directory and enter the following:

PS1="\u@\h:\[\e[33m\]\w\[\e[0m\] \[\`if [[ \$? = "0" ]]; \
then echo '\e[32m=)\e[0m'; else echo '\e[31m=(\e[0m' ; fi\`\] \$ "

Have fun.