2017-01-27 00:35:33 +01:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Feature Detection #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
|
2017-02-18 19:25:27 +01:00
|
|
|
_zsh_autosuggest_feature_detect_zpty_returns_fd() {
|
2017-01-27 00:35:33 +01:00
|
|
|
typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD
|
|
|
|
typeset -h REPLY
|
|
|
|
|
2017-02-18 06:07:48 +01:00
|
|
|
zpty zsh_autosuggest_feature_detect '{ zshexit() { kill -KILL $$; sleep 1 } }'
|
2017-01-27 00:35:33 +01:00
|
|
|
|
|
|
|
if (( REPLY )); then
|
|
|
|
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1
|
|
|
|
else
|
|
|
|
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=0
|
|
|
|
fi
|
|
|
|
|
2017-02-18 06:07:48 +01:00
|
|
|
zpty -d zsh_autosuggest_feature_detect
|
2017-01-27 00:35:33 +01:00
|
|
|
}
|