From f4d28a49dea60bf473b92cb6290cebdfbe4673cb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 20 Oct 2015 14:42:45 +1300 Subject: Handle spaces correctly in completions This is technically still wrong; COMPREPLY needs to be specified with null-delimited IFS, as done in the pass() function. This will do for now. --- bash/bashrc.d/path.bash | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bash/bashrc.d/path.bash') diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash index 29c356ff..e73e6b2f 100644 --- a/bash/bashrc.d/path.bash +++ b/bash/bashrc.d/path.bash @@ -194,6 +194,7 @@ _path() { insert|i|append|add|a|check|c) if ((COMP_CWORD == 2)) ; then compopt -o filenames + local IFS=$'\n' COMPREPLY=( $(compgen -A directory -- "$word") ) fi ;; @@ -201,6 +202,7 @@ _path() { # Complete with any number of directories set|s) compopt -o filenames + local IFS=$'\n' COMPREPLY=( $(compgen -A directory -- "$word") ) ;; -- cgit v1.2.3