Terminal auto complete and arrow keys working incorrectly
The above issue was caused by using ksh shell which seems to be the default for my laptop. After switching it to bash shell, all the above issues have been resolved.