Closed JosephusPaye closed 5 years ago
Hello 👋,
I have an issue similar to https://github.com/wakatime/sublime-wakatime/issues/12, WakaTime shows an popup window on init, and also periodically whenever it sends a heartbeat.
This is really disruptive to work and makes the plugin essentially unusable.
Digging into the source and past issues, I set python_binary in settings to pythonw.exe, as per #8. However, the issue remained.
python_binary
pythonw.exe
Searching online, I found this: https://stackoverflow.com/a/1016651, and made the following temporary changes to WakaTime.py, which fixed the issue.
WakaTime.py
Line 28 (imports):
from subprocess import Popen, STDOUT, PIPE, STARTUPINFO, STARTF_USESHOWWINDOW
Line 320 in find_python_in_folder():
find_python_in_folder()
startupinfo = None if os.name == 'nt': startupinfo = STARTUPINFO() startupinfo.dwFlags |= STARTF_USESHOWWINDOW process = Popen([path, '--version'], stdout=PIPE, stderr=STDOUT, startupinfo=startupinfo)
And similarly at Line 554 in send_heartbeats(), where Popen() is called.
send_heartbeats()
Popen()
So, a combination of pythonw, instead of python for the binary and setting STARTF_USESHOWWINDOW on startupinfo when calling Popen() fixes the problem.
pythonw
python
STARTF_USESHOWWINDOW
startupinfo
Thanks for your time.
Versions:
3.1.1
3176
8.1.2
3.6.4
Thanks for finding this and providing a solution! It's fixed with b39eefb4f570b0e0ec16942b7341689cc01d57ae and released in v8.2.0 just released.
Thanks!
Hello 👋,
I have an issue similar to https://github.com/wakatime/sublime-wakatime/issues/12, WakaTime shows an popup window on init, and also periodically whenever it sends a heartbeat.
This is really disruptive to work and makes the plugin essentially unusable.
Digging into the source and past issues, I set
python_binary
in settings topythonw.exe
, as per #8. However, the issue remained.Searching online, I found this: https://stackoverflow.com/a/1016651, and made the following temporary changes to
WakaTime.py
, which fixed the issue.Line 28 (imports):
Line 320 in
find_python_in_folder()
:And similarly at Line 554 in
send_heartbeats()
, wherePopen()
is called.So, a combination of
pythonw
, instead ofpython
for the binary and settingSTARTF_USESHOWWINDOW
onstartupinfo
when callingPopen()
fixes the problem.Thanks for your time.