Welcome, do
$ set | less and search for "\s\~\S" in function __expand_tilde_by_ref () we have eval $1=$(printf ~%q "${!1#\~}"); should be eval $1=$(printf \~%q "${!1#\~}"); in function _expand () we have _tilde "$cur" || eval COMPREPLY[0]=$(printf ~%q "${COMPREPLY[0]#\~}"); should be _tilde "$cur" || eval COMPREPLY[0]=$(printf \~%q "${COMPREPLY[0]#\~}"); Best regards -- Adam Tlałka System & Network Administration Group IT Service Center, Gdańsk University of Technology, PL