Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tab-autocompletion problem in WSL(window sub linux)

When using tab-completion in WSL(window sub linux), Some commands(cp, ls..) change prompt parameter

example)
define in bash_paths
  export WD=/mnt/c

When I input on prompt cp $WD/ and then press tab, It changes cp \$WD/ but I want to change to cp /mnt/c/ and to know why does it added /

thanks for reading

like image 973
sc84 Avatar asked Dec 06 '25 14:12

sc84


1 Answers

See this answer on askubuntu by user164395.

Just enter the command shopt -s direxpand and you have the behaviour you want. If you don't want to do this every time, add it to the .bashrc file.

Also note that there are other answers to this question like this one from kynan. They suggest pressing ESC followed by Contr+E in order to expand the variable

like image 134
dan1st Avatar answered Dec 08 '25 08:12

dan1st