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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With