Skip to content

Commit

Permalink
Merge pull request #39 from ActivityWatch/dev/hide-module-consoles-on…
Browse files Browse the repository at this point in the history
…-windows

Don't show console window for modules on Windows
  • Loading branch information
ErikBjare authored Aug 27, 2018
2 parents b30757f + 4aed43f commit 9a98933
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion aw_qt/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,17 @@ def start(self) -> None:
exec_cmd.append("--testing")
# logger.debug("Running: {}".format(exec_cmd))

# Don't display a console window on Windows
# See: https://github.com/ActivityWatch/activitywatch/issues/212
if platform.system() == "Windows":
startupinfo = subprocess.STARTUPINFO() # type: ignore
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore
else:
startupinfo = None

# There is a very good reason stdout and stderr is not PIPE here
# See: https://github.com/ActivityWatch/aw-server/issues/27
self._process = subprocess.Popen(exec_cmd, universal_newlines=True)
self._process = subprocess.Popen(exec_cmd, universal_newlines=True, startupinfo=startupinfo)

# Should be True if module is supposed to be running, else False
self.started = True
Expand Down

0 comments on commit 9a98933

Please sign in to comment.