So, I've been pretty happy with my zsh completion and correction configuration for a while now, with this being a major exception.

Configured as I have it, the shell routinely catches and corrects incorrect case when I perform tab completion. For instance, it will easily correct ls ~/DOcuments/somedir to ls ~/Documents/somedir.

However, it is every bit as easy, and notably for precisely the same reasons and in precisely the same manner, to type (for example) cd ~?Somedir<tab>. Of course, the user might reasonably expect the question mark to be considered as a possible mistake, such that (in the absence of a better match) his entry will be corrected to cd ~/Somedir.

But instead, I get this sort of error message:

No matches for: `user' or `named directory'

Or, if I've entered a couple characters after the question mark, I might get a list of suggestions which, I assume (based on their content and the above error message), are active user processes.

Does anybody know an easy way for me to get the desired result?

  • I don't think the question mark is supposed to match slashes. – daniel kullmann May 18 '14 at 18:00
  • Perhaps not. But I want it to, and my tools are "supposed" to do whatever I want them to do. The only correct behavior is behavior which the user finds desirable. QED. – Marshall Eubanks May 18 '14 at 23:23
  • Given the way autocorrect works internally (after the input has been parsed into “home of ?Somedir”), I think this would require significant changes to the code. – Gilles May 18 '14 at 23:34
  • Also the completer can be configured to expand globs and give you all the files matching the patterns (for instance *.txt<Tab> gives you a list of txt files to choose from). ? is a globbing character. – Stéphane Chazelas May 24 '14 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.