From 594825c929f8ac37939e9f056525143a234d6fde Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 31 Mar 2015 00:11:20 +0200 Subject: [PATCH] Fix awful.completion for zsh This fixes 704cf21. --- lib/awful/completion.lua.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/awful/completion.lua.in b/lib/awful/completion.lua.in index 6e371004..4af7dd54 100644 --- a/lib/awful/completion.lua.in +++ b/lib/awful/completion.lua.in @@ -99,9 +99,11 @@ function completion.shell(command, cur_pos, ncomp, shell) local shell_cmd if shell == "zsh" or (not shell and os.getenv("SHELL"):match("zsh$")) then if comptype == "file" then - -- NOTE: wrapped in ${} to make `${"~/.X"}*` work (`"~/X."*` does not). - shell_cmd = "/usr/bin/env zsh -c 'local -a res; res=( " - .. string.format('${%q}', words[cword_index]) .. "* ); print -ln -- ${res[@]}'" + -- NOTE: ${~:-"..."} turns on GLOB_SUBST, useful for expansion of + -- "~/" ($HOME). ${:-"foo"} is the string "foo" as var. + shell_cmd = "/usr/bin/env zsh -c 'local -a res; res=( ${~:-" + .. string.format('%q', words[cword_index]) .. "}* ); " + .. "print -ln -- ${res[@]}'" else -- check commands, aliases, builtins, functions and reswords shell_cmd = "/usr/bin/env zsh -c 'local -a res; "..