added support for ~ and $HOME
changed clear history shell script to native GTK code