Bash history for each project
Previously, I tried to use zsh when I am working, so that my default bash history will not be filled with project related commands, especially git commands. Because some of my bash history are useful like ffmpeg related commands. So, I tried to distinct project work and non-project work with zsh and bash, so that they have different shell histories.
However, there are two problems when I use zsh,
- All my projects use the same zsh history. The old history may be lost if I have too many commands (depends on
HISTSIZEvariable). - zsh is slow with
gitauto-completion.
However, zsh has one thing better than bash, that is, auto-completion navigation. Let’s say your directory has various sub-directories, double tab will bring to directory navigation that can be controlled with arrow keys. This is useful for me to navigate to non-alphabetic directories, like the directory with CJK characters.
bash less resize terminal overflow problem solved
I always have a problem with terminal emulator when using bash but not zsh. The problem can be produced like this,
- Open any terminal emulator (gnome-terminal, xfce4-terminal, etc)
- Run any command with less, such as “ls |less”
- Resize the window to larger size, such as maximize
- Quit less
- Type anything in the terminal, then the text will not wrap to new line if the text length beyond the window size before resie. And it will overflow to the same line and overwrite the prompt.
This problem can be solved by adding “shopt -s checkwinsize” in .bashrc.