Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
When I use tab-completion in zsh, the shell suggests me files and I discover that I'm in the wrong directory. How can I just delete the suggestion instead of backspace'ing it?
You can use the undo command (C-_ or C-x u) to cancel the effect of the last completion.
You can then press C-q or M-q to “suspend” the current command, enter cd correct-directory and resume your editing of that suspended command.
Required, but never shown