Improved text completion in tab completion and post submission command expansion