zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.57k stars 1.88k forks source link

After upgrading zsh 5.5.1 → 5.8.1 : zpty:23: can't open pseudo terminal: bad file descriptor #563

Open avielsh opened 4 years ago

avielsh commented 4 years ago

Describe the bug

Under cygwin x86_64/x86 After upgrading zsh from 5.5.1 to 5.8.1 , and enabling ZSH_AUTOSUGGEST_STRATEGY=(completion), I'm getting the following error after typing commands that trigger suggestions ( IE :ls<space> )

zpty:23: can't open pseudo terminal: bad file descriptor
_zsh_autosuggest_strategy_completion:zpty:24: no such pty command: zsh_autosuggest_completion_pty

Happens with either export ZSH_AUTOSUGGEST_USE_ASYNC=1 or unset ZSH_AUTOSUGGEST_USE_ASYNC

Reverting back to zsh v5.5.1 fixes the issue.

To Reproduce

% zsh -df
% autoload -Uz compinit && compinit
% source .oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
% export ZSH_AUTOSUGGEST_STRATEGY=(completion)
% ls<space>

Expected behavior

The standard completion suggestions

Desktop

Timothy-Gonzalez commented 1 year ago

Just encountered this issue, bumping this with some more information.

On further trial, it appears that zpty doesn't seem to work at all on cygwin? I'm not very familliar with zpty or zsh, but I would thing this would work:

zmodload zsh/zpty
zpty mytest 'echo hi'

But it doesn't?

zpty: can't open pseudo terminal: bad file descriptor

I also found this thread about zpty not working on zsh with cygwin, so maybe this is just a long running issue?

I don't really know were to begin, but any workarounds would be amazing.

teneko commented 1 month ago

Downgrading ZSH to v5.5.1 in Cygwin helped! Thanks @avielsh.