zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.95k stars 1.86k forks source link

Terminal freezes while cloning a git repo #593

Closed szaffarano closed 3 years ago

szaffarano commented 3 years ago

Describe the bug

When I try to clone a git repo with an ssh protocol and its URL includes a custom port, it seems that the underlying command executed is built incorrectly, ie:

if I start typing:

$ git clone ssh://git@some.fqdn:PORT/

The terminal freezes and under the hood, the following command is running

ssh -o BatchMode=yes -a -x ssh://git@some.fqdn command ls -d1FL -- PORT/*

In my case, the terminal freezes because in my network configuration port 22 (default ssh) is blocked and packages are dropped.

To Reproduce

It could be reproduced by typing something similar to my example and debugging what autosuggest executes.

Expected behavior

Terminal working normally and see some suggestions about the git clone command I'm typing.

Screenshots

N/A

Desktop

Additional context

I could work around it by setting ZSH_AUTOSUGGEST_USE_ASYNC variable.

ericfreese commented 3 years ago

As of the newest version, async mode is enabled by default. Give that a shot. Like you mentioned, I think the answer in this case is to use async mode.

szaffarano commented 3 years ago

Thanks!