Terminus panel opens without focus on Windows 10
Steps to reproduce:
- Open a folder in ST4
- Press the
toggle_terminus_panelshortcut, the panel opens - Start typing
- Key presses don't register because the entire Sublime Text window went out of focus. Clicking on the panel is necessary to bring it back.
I initially suspected something running on cmd startup and stealing focus, but trying it in a Windows Sandbox on a fresh ST4 + Terminus install results in the same outcome.
Same for normal views. Fixable by forcing the plugin to run on py33.
Noticeable is that on py38 typing lags, e.g. ipython really has some input lag. Downgrading to py33 solves that too.
Downgrading worked, thanks for the suggestion!
To save time for anyone hitting this issue in the future, here's how to do it:
- Create a new directory
%APPDATA%\Sublime Text\Packages\Terminusif one doesn't exist yet - Add a new file
.python-versionthere with content3.3 - Restart Sublime Text
That makes it hard to fix as it looks like -- py38 itself cannot be the cause, can it? -- that the dependencies, the specific versions that load for py38 aren't that good. From top of my head, I wouldn't even know how to find out which versions Terminus use, and if there are newer/older ones that could work. How could we bisect the dependency versions.
Do you actually use the new console/Terminal or the old conhost. I wonder if newer versions try to use the newer console API. I'm running the new one not the legacy. (https://learn.microsoft.com/en-us/windows/console/legacymode)
Ok. I cannot reproduce this on the command line, in an ipython repl running 3.8. Code to execute is
>>> from winpty import PtyProcess
>>> proc = PtyProcess.spawn('python')
The same code also works when I run it in Sublime's py33 console, and it steals/destroys focus when it is run on the py38 console. (But only on the first invocation! A subsequent call will work as usual.) So my hunch is that it is a Sublime issue.
For the lag, it is a known issue https://github.com/andfoy/pywinpty/issues/463 The issue is closed as "wait for upstream" right now.