diff options
author | Vidar Holen <vidar@vidarholen.net> | 2019-11-26 04:36:31 -0800 |
---|---|---|
committer | Mischievous Meerkat <engineerarun@gmail.com> | 2019-11-26 18:06:31 +0530 |
commit | 1bf49c80e734d7fdefda0686d81f95a1ce619b10 (patch) | |
tree | adb7b70347495d4994916a130edd963d88f76f6a /misc/auto-completion | |
parent | e81efdb5e6b7689f7e34c0c15e605aeaa6f8b424 (diff) | |
download | nnn-1bf49c80e734d7fdefda0686d81f95a1ce619b10.tar.gz |
Some of the shell script fixes as per discussion (#389)
* Improved completion support for files with spaces
Filenames with spaces, both generally and for session names, will now
complete as expected.
* Misc shell script improvements
See discussion on:
https://github.com/jarun/nnn/commit/1cca9e4b72b106374f203890b266f18609deefe3
Diffstat (limited to 'misc/auto-completion')
-rw-r--r-- | misc/auto-completion/bash/nnn-completion.bash | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/auto-completion/bash/nnn-completion.bash b/misc/auto-completion/bash/nnn-completion.bash index 638df49..6b73d05 100644 --- a/misc/auto-completion/bash/nnn-completion.bash +++ b/misc/auto-completion/bash/nnn-completion.bash @@ -8,7 +8,7 @@ _nnn () { COMPREPLY=() - local IFS=$' \n' + local IFS=$'\n' local cur=$2 prev=$3 local -a opts opts=( @@ -37,7 +37,7 @@ _nnn () COMPREPLY=( $(compgen -f -d -- "$cur") ) elif [[ $prev == -e ]]; then local sessions_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions - COMPREPLY=( $(compgen -W "$(ls "$sessions_dir")" -- "$cur") ) + COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") ) elif [[ $cur == -* ]]; then COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") ) else |