As I am using Linux and the terminal more and more I came across some annoyances and limitations of the default bash terminal in Ubuntu and OSX. In this article, I will describe how discovered what I am missing in the default terminal and how I learned how to overcome the shortcomings of bash with some simple and more complex extensions and tools.
Terminal Window multiplexer
Even for simple tasks, it is very often necessary or at least helpful to open more than one terminal window at once. For example when you need to make changes to a configuration script in nano or vim in one terminal and run the execution in another one. Or when you want to run one server script in one window and a client script in a second one. I needed to do this kind of tasks often enough to be annoyed by the fact that I have to open several windows just to run commands at the same time. My first try for solving this was using the terminal emulator Terminator . With its shortcuts and context menus, you can solve this problem by splitting a terminal session horizontally and vertically several times.
Terminator has the advantage as well that you can change the color profile with lots of presets and you can use your mouse cursor to change window sizes. This is a very common solution to the above discribed problem in the Linux world. The caveat for me as an OSX and Linux user is that Terminator is not cross-platform. There are similar tools for OSX like iTerm2 but it uses different shortcuts for splitting windows again, which makes it a mess changing systems several times a day. Still, its a very good tool and several advanced features compared to the default OSX terminal.
I use both iTerm2 and Terminator for lots of there features but not for splitting windows. What I found to be my tool of choice is tmux as it runs directly in one terminal window and can therefore also be started in a ssh session from the remote machine without starting several ssh connections.
Tmux is a great tool if you like shortcuts a lot. Otherwise, you will get frustrated quickly as tmux is fully controlled by your keyboard. This can definitely also be called its strong point, as your hands don’t need to leave the homerow. As I am using a German keyboard where the default shortcuts of tmux are a lot harder to use than on an English keyboard I changed mine to be more friendly combinations.
66 # split current window horizontally 67 bind - split-window -v 68 # split current window vertically 69 bind _ split-window -h 70 71 # pane navigation 72 bind -r h select-pane -L # move left 73 bind -r j select-pane -D # move down 74 bind -r k select-pane -U # move up 75 bind -r l select-pane -R # move right
All my shortcuts start with a CMD + A combination. As the CMD key is not on the home row, I changed my Caps lock key to an additional CMD key. This helps a lot in typing and navigating speed and I really don’t need the Caps lock key anyway. In OSX you can do that with the system settings and in Ubuntu, the Gnome Tweek tools can do that.
One more quick tip is to change the default key registration and repeat speed of your keyboard to something a lot quicker. By doing that your pc feels so much faster and navigating the terminal is lots faster.
In addition to this configuration, you can do lots more which helps to make tmux more feature rich and nice looking.
Everything Bash can’t do
Bash can be a very quick tool when you know how to use it and watch some YouTube videos on useful tools and tricks or follow Julia Evans on Twitter to learn new stuff in small comic style like cards. Still, you will find after a while that some fundamental functions are missing which will be frustrating in the long run.
This is where zsh and the community-driven framework oh my zsh comes to the rescue. Zsh (spoken C shell) is basically a replacement for the default Bash and can be installed simply via apt-get. Zsh gives you advanced features like auto-completion for commands, path, and arguments in commands without being case sensitive.
By tapping your way through the options you can navigate through your folders and arguments without having to type more letters as you do in Bash. Zsh in combination with oh my zsh has so many features, plugins and options that I would need to write an article alone.
Very soon after installing the mentioned tools, you will discover all the possibilities on your own and love them, but hate all the options and time they need for understanding😅. I definitely don’t regret spending a fair amount of time on my configuration and am pleased with all the time and frustration I am saving now on a daily bases.