mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 04:09:08 -05:00
fix: keep cmd.exe off the terminal under WSL
Reading the Windows variables through cmd.exe let it consume the answer typed at the first prompt: a WSL run exited 0 with nothing installed.
This commit is contained in:
1 parent
3bb178bb74
commit
f19dcba545
4 files changed
+9
-4
No files matched your search
+3
-1
@@ -467,9 +467,11 @@ def _enter_wsl() -> None:
|
||||
if os.environ.get(variable):
|
||||
continue
|
||||
try:
|
||||
# No stdin: cmd.exe inherited the terminal and swallowed the
|
||||
# answer typed at the first prompt.
|
||||
result = subprocess.run(
|
||||
["cmd.exe", "/c", f"echo %{variable}%"],
|
||||
capture_output=True, text=True, timeout=10,
|
||||
capture_output=True, text=True, timeout=10, stdin=subprocess.DEVNULL,
|
||||
cwd="/mnt/c" if Path("/mnt/c").is_dir() else None,
|
||||
)
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
|
||||
Reference in new issue
Block a user