Non interactive and advanced .bashrc startup file loading #23
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.
This adds a feature to enable more flexible management of which startup files run with WSLgit as discussed in issue #16
Windows 10 builds less than 17063
No change.
Launches git in interactive, non-login bash shell.
Windows 10 builds 17063 and later
Optional change.
Launches git in interactive or non-interactive, non-login bash shell.
BASH_ENV
is set and variableWSLENV
contains "BASH_ENV", then WSLgit is launched into WSL bash with a non-interactive non-login shell. e.g.BASH_ENV=~/.bashrc
WSLENV=VAR1:BASH_ENV:VAR3:VAR4
BASH_ENV
variable and load the given file. In that file, you can detect it being interactive or non-interactive and manage things you want to do in each case. For example, you may want to always set variables for GPG, SSH, etc. However, for non-interactive shells, you may want to skip slow actions.Launching WSLgit as non-interactive and skipping slow actions in .bashrc can significantly speed the responsiveness of WSLgit. For example, it changed my response time from several seconds down to microseconds.
This PR uses
wsl.exe
to launch into WSL instead of the deprecatedbash.exe
.Example .bashrc