mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Need to prevent zpty feature detection from HUPing existing zptys
This commit is contained in:
parent
c959408305
commit
c4bfd8e2c6
3 changed files with 8 additions and 9 deletions
|
@ -1,11 +1,10 @@
|
||||||
describe 'a running zpty command' do
|
describe 'a running zpty command' do
|
||||||
it 'is not affected by running zsh-autosuggestions' do
|
let(:before_sourcing) { -> { session.run_command('zmodload zsh/zpty && zpty -b kitty cat') } }
|
||||||
session.run_command('zmodload zsh/zpty')
|
|
||||||
session.run_command('zpty -b kitty cat')
|
|
||||||
session.run_command('zpty -w kitty cat')
|
|
||||||
sleep 1
|
|
||||||
session.run_command('zpty -r kitty')
|
|
||||||
|
|
||||||
wait_for(session.content).to end_with("\ncat")
|
it 'is not affected by running zsh-autosuggestions' do
|
||||||
|
sleep 1 # Give a little time for precmd hooks to run
|
||||||
|
session.run_command('zpty -t kitty; echo $?')
|
||||||
|
|
||||||
|
wait_for(session.content).to end_with("\n0")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ _zsh_autosuggest_feature_detect() {
|
||||||
typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD
|
typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD
|
||||||
typeset -h REPLY
|
typeset -h REPLY
|
||||||
|
|
||||||
zpty $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME :
|
zpty $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME '{ zshexit() { kill -KILL $$; sleep 1 } }'
|
||||||
|
|
||||||
if (( REPLY )); then
|
if (( REPLY )); then
|
||||||
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1
|
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1
|
||||||
|
|
|
@ -122,7 +122,7 @@ _zsh_autosuggest_feature_detect() {
|
||||||
typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD
|
typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD
|
||||||
typeset -h REPLY
|
typeset -h REPLY
|
||||||
|
|
||||||
zpty $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME :
|
zpty $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME '{ zshexit() { kill -KILL $$; sleep 1 } }'
|
||||||
|
|
||||||
if (( REPLY )); then
|
if (( REPLY )); then
|
||||||
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1
|
_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1
|
||||||
|
|
Loading…
Reference in a new issue