Skip to content
Myr

[shell] Use cd -- (#2659)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Otherwise directories starting with '-' may treated as options.

authored by zsugabubus · committed by GitHub · parent 3715cd3 · Browse files · 3 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+3 added−3 removed

  • other:+3 added−3 removed

3 files+3 added−3 removed

modified:shell/key-bindings.bash+1 added-1 removed
modified:shell/key-bindings.fish+1 added-1 removed
85 unmodified lines
86 set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"87 eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result8889 if [ -n "$result" ]90 cd $result90 cd -- $result9192 # Remove last token from commandline.93 commandline -t ""94 commandline -it -- $prefix
78 unmodified lines
modified:shell/key-bindings.zsh+1 added-1 removed
77 unmodified lines
78 zle redisplay79 return 080 fi81 zle push-line # Clear buffer. Auto-restored on next prompt.82 BUFFER="cd ${(q)dir}"82 BUFFER="cd -- ${(q)dir}"83 zle accept-line84 local ret=$?85 unset dir # ensure this doesn't end up appearing in prompt expansion86 zle reset-prompt
28 unmodified lines