Skip to content

Commit 06ff8aa

Browse files
committed
fix: add CREATE_NO_WINDOW flag to prevent child console windows from flashing on Windows background operations
1 parent 86f513a commit 06ff8aa

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

ghostcoder/backends/gpu_tier.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,14 @@ def detect(cls) -> GPUTier:
8282

8383
try:
8484
# Query nvidia-smi for total VRAM (in MiB) and GPU Name
85+
import sys
86+
creation_flags = 0x08000000 if sys.platform == "win32" else 0
8587
res = subprocess.run(
8688
["nvidia-smi", "--query-gpu=name,memory.total", "--format=csv,noheader,nounits"],
8789
capture_output=True,
8890
text=True,
89-
check=True
91+
check=True,
92+
creationflags=creation_flags
9093
)
9194
output = res.stdout.strip()
9295
if not output:

ghostcoder/session.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,32 @@ def _ensure_session_dir(self):
3434
def load_git_context(self):
3535
"""Read Git status using subprocess or fallback gracefully."""
3636
import subprocess
37+
import sys
38+
creation_flags = 0x08000000 if sys.platform == "win32" else 0
3739
try:
3840
# Branch
3941
branch_proc = subprocess.run(
4042
["git", "rev-parse", "--abbrev-ref", "HEAD"],
41-
cwd=self.project_path, capture_output=True, text=True, timeout=2
43+
cwd=self.project_path, capture_output=True, text=True, timeout=2,
44+
creationflags=creation_flags
4245
)
4346
if branch_proc.returncode == 0:
4447
self.git_branch = branch_proc.stdout.strip()
4548

4649
# Last commit
4750
commit_proc = subprocess.run(
4851
["git", "log", "-1", "--pretty=format:%h - %s"],
49-
cwd=self.project_path, capture_output=True, text=True, timeout=2
52+
cwd=self.project_path, capture_output=True, text=True, timeout=2,
53+
creationflags=creation_flags
5054
)
5155
if commit_proc.returncode == 0:
5256
self.git_last_commit = commit_proc.stdout.strip()
5357

5458
# Status
5559
status_proc = subprocess.run(
5660
["git", "status", "--short"],
57-
cwd=self.project_path, capture_output=True, text=True, timeout=2
61+
cwd=self.project_path, capture_output=True, text=True, timeout=2,
62+
creationflags=creation_flags
5863
)
5964
if status_proc.returncode == 0:
6065
self.git_status = status_proc.stdout.strip()

0 commit comments

Comments
 (0)