add some code to deal shell and eshell history