♻️ Use .sh extension on shell compatible terminals on Windows#196
Closed
teikitel wants to merge 1 commit into
Closed
♻️ Use .sh extension on shell compatible terminals on Windows#196teikitel wants to merge 1 commit into
teikitel wants to merge 1 commit into
Conversation
On Windows with Git Bash, when hitting CTRL+C when running for example a java CLI from command launcher, the terminal crashes because the underlying execution is actually passed down a .bat script execution. In Git Bash, we actually don't need to use the .bat version. The .sh version will even be more efficient. To detect that we're in Git Bash, we use the environment variable MSYSTEM. Here we also rename occurrences of "os" used as OS name "osName" to avoid confusions with the "os" library. Change-Id: I5bed4dc2282533d75bceccba67ad05b9c1094f0d
hdost
approved these changes
Apr 8, 2026
bhou
approved these changes
Apr 8, 2026
Contributor
bhou
left a comment
There was a problem hiding this comment.
I don't have a windows environment at hand, I am wondering the situation in WSL environment, what will be the osName, and should we handle it here as well? But that could be another PR.
Contributor
In WSL the OS name is Unix based like Ubuntu. |
Contributor
Author
|
In fact I test on Windows and it's not enough. As the command launcher is a native process, the underlying subcommand is forked as native process.
I'll push another approach to handle signals from command-launcher and allow for a more graceful shutdown. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows with Git Bash, when hitting CTRL+C when running for example a java CLI from command launcher, the terminal crashes because the underlying execution is actually passed down a .bat script execution.
In Git Bash, we actually don't need to use the .bat version. The .sh version will even be more efficient.
To detect that we're in Git Bash, we use the environment variable MSYSTEM.
Here we also rename occurrences of "os" used as OS name "osName" to avoid confusions with the "os" library.
Change-Id: I5bed4dc2282533d75bceccba67ad05b9c1094f0d