I want to read a string from a user (using read builtin or something similar), with all completions enabled for normal shell usage. In other words, I want ZSH to complete all commands but after pressing ENTER I don’t want ZSH to execute the command, but pass the string to my script. How can I achieve this?
I want to read a string from a user (using read builtin or something
Share
To read a line with edition and completion, call the
varedbuiltin.Completion will work as if you were in the value part of a parameter assignment (because that’s what
vareddoes). If you want completion like a normal command line, I think you need to fiddle with_completeto make it forget about being insidevared.