* brace in alias name and compsys
@ 2013-12-15 7:36 Phil Pennock
2013-12-15 19:52 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Phil Pennock @ 2013-12-15 7:36 UTC (permalink / raw)
To: zsh-users
Given this:
% alias ztrace{='() { setopt localoptions xtrace; '
I can do this:
% ztrace{ [[ a == 43 ]] }
+(anon):0> [[ a == 43 ]]
%
However, tab-completing 'ztrace{' yields 'ztrace\{'. Hitting return on
a line with the backslash in it yields a:
zsh: command not found: ztrace{
and a 127 exit status.
Working from "zsh -f", initially tab-completion yields "ztrace{" without
the backslash and everything works fine, but all it takes to get the
broken completion behaviour back is:
% autoload compinit ; compinit
So this isn't anything in my grotesquery of a configuration and appears
to be straight from compsys.
Is there anything I can tune to change the completion behaviour to not
insert the extraneous backslash?
Thanks,
-Phil
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: brace in alias name and compsys
2013-12-15 7:36 brace in alias name and compsys Phil Pennock
@ 2013-12-15 19:52 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2013-12-15 19:52 UTC (permalink / raw)
To: zsh-users
On Dec 15, 2:36am, Phil Pennock wrote:
}
} Given this:
}
} % alias ztrace{='() { setopt localoptions xtrace; '
}
} However, tab-completing 'ztrace{' yields 'ztrace\{'.
This is coming directly from "compadd -k aliases" which in turn is
hardwired in the "defs" array in _command_names.
There's a similar problem with e.g. completing the builtin "!" "command".
It always gets turned into "\!" instead.
Can anyone think of a situation in which the following is wrong?
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 24933c2..d9fc62d 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -27,11 +27,11 @@ else
[[ "$1" = - ]] && shift
defs=( "$defs[@]"
- 'builtins:builtin command:compadd -k builtins'
+ 'builtins:builtin command:compadd -Qk builtins'
"functions:shell function:compadd -k 'functions$ffilt'"
- 'aliases:alias:compadd -k aliases'
+ 'aliases:alias:compadd -Qk aliases'
'suffix-aliases:suffix alias:_suffix_alias_files'
- 'reserved-words:reserved word:compadd -k reswords'
+ 'reserved-words:reserved word:compadd -Qk reswords'
'jobs:: _jobs -t'
'parameters:: _parameters -g "^*readonly*" -qS= -r "\n\t\- =["'
)
While we're on the subject, completing after "[" or "[[" in command
position (no intervening whitespace) incorrectly attempts subscript
completion. This appears to be a bug somewhere in the internals,
because compstate[context] has been set to 'subscript' and there's no
assignment to that in _complete_debug output.
Aside: Zsh is unique, I think, in allowing alias names to contain
characters that are not legal in identifiers.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-15 19:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-15 7:36 brace in alias name and compsys Phil Pennock
2013-12-15 19:52 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).