Fix $ZSH_CUSTOM variable #1111

Merged
merged 2 commits into from May 21, 2012

Projects

None yet

5 participants

@jimeh
Contributor
jimeh commented May 6, 2012

When you set $ZSH_CUSTOM to anything else than $ZSH/custom two odd things happen:

  • If there are no *.zsh files in your new $ZSH_CUSTOM path, zsh prints a "no matches found" error.
  • Themes in $ZSH_CUSTOM can not be loaded.

This pull request fixes both of those issues :)

jimeh added some commits May 6, 2012
@jimeh jimeh Suppress "zsh: no matches found" error when $ZSH_CUSTOM has no files
The addition of `(.N)` enables the `NULL_GLOB` option which suppresses
the error output in question.

Reference: http://www.zsh.org/mla/users/2004/msg00621.html
51c55ad
@jimeh jimeh Load themes from `$ZSH_CUSTOM` instead of `$ZSH/custom`
This seems like a simple oversight, everything else uses `$ZSH_CUSTOM`
rather than `$ZSH/custom`.
f9018c5
@padde
padde commented May 6, 2012

i have already filed a pull request concerning the second point: #1107 +1 anyway!

@jimeh
Contributor
jimeh commented May 7, 2012

Oops, not sure how I failed to see your pull request :)

@padde
padde commented May 8, 2012

no problem. i am happy with either commit being pulled :)

@robbyrussell robbyrussell merged commit e6fc2c6 into robbyrussell:master May 21, 2012
@kusnier
kusnier commented May 21, 2012

The solution in #753 is better for custom themes.

For plugins in custom folder we already use the folder "plugins":
See:

for plugin ($plugins); do
if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
  elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
  fi
done

Why no themes folder in custom?

@jimeh
Contributor
jimeh commented May 21, 2012

@kusnier A themes folder in the custom folder makes sense to me. I simply quickly fixed what looked like a typo... lol

Poke @robbyrussell or submit a pull request ;)

@kusnier
kusnier commented May 21, 2012

For this fix we have already more then 5 pull requests. I will start the next :D

@nathasm

On OSX, when you want to hit ctrl-D to kill the shell, this change treats it as a tab completion command. Is this the expected behavior? All other shells I'm familiar with will kill the shell with a ctrl-D on an empty line.

Contributor

@nathasm That's weird, I don't fully see how that's possible. Also I kill all my shells with ctrl+d, and it's been working fine for me ever since I committed this.

Would you mind elaborating a bit more on how/when/where and in what situations ctrl+d isn't working? :)

Hm, nevermind. I was having that issue and reverted this change in my local branch which seemed to fix it. But going back to master as a sanity check didn't expose the issue. Something else must be causing ctrl-d to act as tab-complete in my local branch.

This was referenced Dec 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment