Fix some bug in history.bash

1. Join commands with multiple lines into one line in history file.
2. Now gh, ggh, lh, glh would also be stored in history file