dc9e1764cfd0987f104f57bac0b974e0941f1e42

Author
Jingwen Owen Ou <jingweno@gmail.com>
Committer
Jingwen Owen Ou <jingweno@gmail.com>
Date

Message

Fix missing add-zsh-hook

In older version of zsh, `add-zsh-hook` is not available, causing issues like:

```
/Users/hugo/.oh-my-zsh/lib/termsupport.zsh:32: add-zsh-hook: function definition file not found
/Users/hugo/.oh-my-zsh/lib/termsupport.zsh:33: add-zsh-hook: function definition file not found
```

See https://github.com/robbyrussell/oh-my-zsh/issues/748. This patch pulls in the changes suggested in https://github.com/robbyrussell/oh-my-zsh/issues/748#issuecomment-37862691 by @mcornella and I have tested it on RHEL 5.

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index 9c0a430fb9bc676fec0810822de552c655687894..9d668160310c53516cf81d0366d96a3cd3f8d285 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -34,6 +34,5 @@ function omz_termsupport_preexec {
 6   title '$CMD' '%100>...>$LINE%<<'
 7 }
 8 
 9-autoload -U add-zsh-hook
10-add-zsh-hook precmd  omz_termsupport_precmd
11-add-zsh-hook preexec omz_termsupport_preexec
12+precmd_functions+=(omz_termsupport_precmd)
13+preexec_functions+=(omz_termsupport_preexec)