Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call cmd.exe if not needed #137

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

ryncsn
Copy link
Contributor

@ryncsn ryncsn commented Oct 31, 2021

Hi, I found starting new subshell in WSL2 with this Fedora remix is really slow, and found the reason is caused by this 00-remix.sh, I tried to fix it, as long as WIN_HOME is not a variable that changes from time to time, this fix should be valid, please have a look.

cmd.exe is called in 00-remix.sh to get and set the WIN_HOME variable.

When spawning multiple shell instances inside a already running interactive
shell, this cmd.exe call slows down the startup speed by a lot, skip this call
if WIN_HOME is already set.

cmd.exe is called in 00-remix.sh to get and set the WIN_HOME variable.

When spawning multiple shell instances inside a already running interactive
shell, this cmd.exe call slows down the startup speed by a lot, skip this call
if WIN_HOME is already set.
@crramirez crramirez merged commit 45d57d1 into WhitewaterFoundry:master Nov 3, 2021
@crramirez
Copy link
Contributor

Thank you for your contribution. It looks like great

@leonbloy
Copy link

leonbloy commented Mar 4, 2022

This almost fixes my issue #129
but with two caveats:

  1. I think it's not foolproof to rely on the definition of $WIN_HOME
    It will not be available if setting (as was my case)
[interop]
appendWindowsPath=false

I would be better to define some ad-hoc env variable like WSL_00_REMIX_DONE=1 or something like that

  1. We want to avoid the unnecesary heavy tasks in child shells. I think it would be better to except, not only
    the block that starts with the comment # Check if we have Windows Path
    but also the lines
setup_display
# if dbus-launch is installed then load it
if (command -v dbus-launch >/dev/null 2>&1); then
  eval "$(timeout 2s dbus-launch --auto-syntax)"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants