Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

migrated from serverfault.com Nov 21 '11 at 0:12

This question came from our site for professional system and network administrators.

1 Answer 1

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.

share|improve this answer
    
Thanks Gilles. Hmm they all do not work, but I guess that is because I'm using iTerm on Mac, and the key combinations are actually triggering iTerm. For example, M-q quits iTerm :-/ –  Daniel Nov 18 '11 at 22:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.