-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture and report errors from the Microsoft Bash Launcher (bash.exe)
In the elevated/non-elevated situation, this output appears now: $ ./out/wslbridge.exe wslbridge error: failed to start backend process note: bash.exe output: Cannot launch bash because another instance is running elevated. Elevated and un-elevated instances are not permitted to run simultaneously. This work would have been a lot easier if bash.exe didn't put up a "Press any key to continue" prompt after it prints the error. wslbridge works around the prompt by synthesizing a VK_RETURN keypress into the console. wslbridge uses a new console, unrelated to the console Cygwin is using (whether visible or hidden). I don't want to disconnect from the existing console, mostly because in theory, wslbridge.exe could be the only process attached to a visible console. Instead, wslbridge spawns a copy of itself with a --press-return argument. This child attaches to the new bash.exe console to insert the VK_RETURN. wslbridge assumes that stdout is UTF-16, while stderr is UTF-8. This works for now, at least. I noticed that the access X_OK check wasn't working anymore. Apparently Cygwin considers these paths executable: - C:\some\path\cygprog.exe - C:\some\path\elf64prog - /cygdrive/c/some/path/cygprog.exe But not this path: - /cygdrive/c/some/path/elf64prog Anyway, as of 15063, and this commit, if the wslbridge-backend file isn't executable, the underlying bash.exe error is reported: $ ./out/wslbridge.exe wslbridge error: failed to start backend process note: backend error output: /bin/bash: /mnt/c/rprichard/proj/wslbridge/out/wslbridge-backend: Permission denied Fixes #13
- Loading branch information
Showing
1 changed file
with
259 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters