@@ -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