fix cd to dirs with spaces

This commit is contained in:
Loic Nageleisen 2014-09-29 12:36:40 +02:00
parent 9be443814c
commit c393dca551

View file

@ -10,7 +10,7 @@ function precmd { :; }
function chpwd { :; } function chpwd { :; }
__cd_invoke_chpwd() { __cd_invoke_chpwd() {
builtin cd $@ builtin cd "$@"
chpwd chpwd
} }
@ -27,7 +27,7 @@ __preexec_invoke_exec () {
# set up the hooks # set up the hooks
PROMPT_COMMAND="precmd" PROMPT_COMMAND="precmd"
trap '__preexec_invoke_exec' DEBUG trap '__preexec_invoke_exec' DEBUG
cd() { __cd_invoke_chpwd $@; } cd() { __cd_invoke_chpwd "$@"; }
# clears a line that was not terminated by a LF fixing the dangling prompt # clears a line that was not terminated by a LF fixing the dangling prompt