Open abarani opened 4 years ago
Good catch! There's an inherent danger in using setx
to immortalize the contents of an environment variable at runtime, because even TEST/p
is going to get duplicated if you keep doing that ...
I'm not sure it harms anything other than aesthetics, but I'll tag this one up as a code health issue.
Hello, this is my first time making a contribution here! I would like to work on this.
@huiyooumich awesome, go for it! I don't think you'd be stepping on anyone's toes here. I'm pretty sure ConptyConnection::_LaunchAttachedClient
in ConptyConnection.cpp
is where we're setting up the environment variables. Let us know if you need any pointers ☺️
Unfortunately, I have stopped working on this due to lack of time. But thank you so much for the advice and I hope if anyone else wants to give this a go they'll find it a lot easier.
Environment
Steps to reproduce
setx WSLENV "${env:WSLENV}:TEST/p"
echo $env:WSLENV
Expected behavior
Actual behavior
I think the right thing to do here is to split
WSLENV
by:
and check those vars are already set instead of just simply prepending and appending a string.Probable related PRs: