use trimspace instead of trimright
fix zsh history reader
fix error message