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.

I'm using oh-my-zsh on Mac OS X with homebrew'ed zsh 4.3.12. I stumbled recently on a weird problem. In scripts/not-used I have several .R files:

breakdowns.R             eventloop.R              process-largeclients.R   process-qt.R
reprocess-pinning.R      calculate-qt-error.R     generate_decision_tree.R process-net.R

However, when I try ls scripts/not-used/+Tab the first completion is ls scripts/not-used/_.R where _ represents cursor position. If I press Tab again, I get this weird completion:

$ ls scripts/not-used/.R                                                                          
breakdowns.R  eventloop.R

How to unset this ugly (wrong) behaviour?

The options that are set are:

alwaystoend autocd autonamedirs autopushd cdablevars completeinword
correctall extendedglob extendedhistory noflowcontrol
histexpiredupsfirst histignoredups histignorespace histreduceblanks histverify
interactive login longlistjobs monitor promptsubst 
pushdignoredups pushdminus pushdsilent pushdtohome
sharehistory shinstdin zle
share|improve this question
how is breakdowns.R eventloop.R incorrect completion? Try unsetting the completeinword option, as this allows completion to be done from both ends of the cursor, left and right. That means, that if I type pac as in pacman, and there's a command called arpac, then arpac will be in the list of completions, since completion occurs on both sides of the cursor instead of only to the right. –  Alexej Magura Dec 23 '13 at 16:53
I wasn't aware of the question... So, breakdowns.R eventloop.R is an incorrect completion, in the sense of incompleteness. If you look closely at the list of files, there are more than just those 2, ending with .R. –  Nikola Knezevic Jul 21 '14 at 6:57
I tried touching into existence a bunch of files with the same names as the ones you listed as well as a z.R, a z,.R and a z_test.R for testing purposes - z_test.R wouldn't show up trying to autocomplete it, but z,.R would. Guessing it's some kind of regex mishap –  Dmitri DB Sep 15 '14 at 19:13
This may be related to github.com/robbyrussell/oh-my-zsh/issues/1398, which is an old issue, but the latest version has similar completion code. I did not attempt work-arounds to confirm. –  rjewell Dec 16 '14 at 17:38

1 Answer 1

Did you notice where it put your cursor? Since all files end with .R, it's automatically appending the possible suggestion for you.

The autocomplete is using "both ends" as described by Tshepang.

Try dropping a file into this folder without a .R name, and you'll see that .R bit go away.

Honestly, autocomplete actually needs something to "complete" not a blind directory assumption.

share|improve this answer

Your Answer


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.