Describe the bug
After the installation of jedi-vim, vim freezes in Windows Terminal or powershell on python file opening, so that I need to terminate the process, because vim does not accept any commands. However, jedi-vim works well in gVim.
I researched a little bit, there is something to do with :python3 import or python installation in general. I tried to disable all vim modules and execute :python3 import sys; print(sys.version) – the vim got frozen and doesn't react on any keys, though the cursor is blinking.
I reinstalled python and vim again, checked environment variables, but the issue with python import still persists.
In gVim :python3 import sys; print(sys.version) executes fine.
To Reproduce
Detailed steps to reproduce the behavior:
vim in Windows Terminal or in Powershell:python3 import sysExpected behavior
Vim shall not freeze on python import command.
Screenshots
N/A
Environment (please complete the following information):
Windows 10 Pro x64 2004
PowerShell 7.0.3
Windows Terminal 1.3.2651.0
Vim version 8.2.1801
Python 3.8.5/3.8.6 x64
Additional context
N/A
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Thank you @mattn , I scrolled through the links you gave, however, it was a bit complicated for me to interpret the content properly. Is it already fixed or still in process? Is there any workaround?
I have the same issue. Also looking for a workaround or fix.
Please use 8.2.1789 or earlier for a while. We are preparing a fix.
Using https://chocolatey.org/packages/vim/8.2.1787 without issue now! Thank you for the quick response.
Thank you, @mattn.
I confirmed that your patch worked fine (also with Vifm).
I hope a few more people try this.
BTW, maybe the comments (two parts) should be updated. E.g. "Reconnect stdin to CONIN$ or NUL."
Verified that it worked too. @mattn Thank you.
Fix for this issue broke #7053 again, so I played with a simple isatty-program as the one on this MSDN page. When I do a.exe < NUL, redirection isn't detected. It's Windows we're dealing with here...
This, however, seems to detect redirection (can't query console mode of something other than the console):
diff --git a/src/if_python3.c b/src/if_python3.c index f6904c380..cf681377e 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -938,7 +938,9 @@ reset_stdin(void) if (hpystdiodll) pyfreopen = (void *)GetProcAddress(hpystdiodll, "freopen"); } - if (isatty(fileno(stdin))) + + DWORD ignored_mode; + if (GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &ignored_mode)) stdin_name = "CONIN$"; // Reconnect stdin to NUL or CONIN$.
I can't reproduce #7083 (this issue) on Windows 7 (no hang), but it does fix #7053. Can someone confirm that it doesn't break anything?
Please use 8.2.1789 or earlier for a while. We are preparing a fix.
This version freezes as well. Strange behavior noticed:
:python3 import sys; print(sys.version) executes well without freezingOR
repeatedly open/save/close/reopen the python file causes vim to freeze occasionally.
Please try 8.2.1830 or later.
From 8.2.1381 to 8.2.1829 have some issues with python 3.
@k-takata I have been using 8.2.184 for a few days and I have not been able to reproduce the issue.
Are you talking about 8.2.1840?
Yes. Sorry. 184->1840
I have been using 8.2.1840 for a few days and I have not been able to reproduce the issue.