Comments (7)
Ah, clever! export
makes a clear separation between the entities:
$ env -i V1='
> V2=2
> ' bash -c export
declare -x OLDPWD
declare -x PWD="/home/bf/areas/itadmin/nixos-config"
declare -x SHLVL="1"
declare -x V1="
V2=2
"
I also tested the extension again (after re-introducing my bug from the OP) and your extension works flawlessly. (I tested version 1.0.2.)
Thanks!
from nix-env-selector.
Hmm, it's strange. Because the extension doesn't parse the nix-config, only pass the path to config to the native nix-shell command. But I'll take a look.
from nix-env-selector.
I think you misunderstand. The problem is in how the environment variables produced by nix-shell --run env
gets interpreted wrongly.
from nix-env-selector.
I think you misunderstand. The problem is in how the environment variables produced by
nix-shell --run env
gets interpreted wrongly.
I changed the env parsing implementation in the new version. Can you try your case with the new one?
Also, can you dump your env with the command nix-shell --run export
If the problem still appears.
from nix-env-selector.
Before I do that (it takes some time to setup again), is the mechanism still depending on parsing the output of env
?
If so I think it cannot work, because the newlines output by env
to separate variables is indistinguishable from newlines inside env vars.
Example, V1
is a multi-line variable containing the text V2=2
, but in the output it looks like V2 is a variable too (it is not):
$ env -i V1='
V2=2
' env
V1=
V2=2
Maybe using /proc/self/environ
is a better approach? (It's NULL-terminated.)
$ env -i V1='
V2=2
' hexdump -C /proc/self/environ
00000000 56 31 3d 0a 56 32 3d 32 0a 00 |V1=.V2=2..|
0000000a
from nix-env-selector.
Now extension use export
instead of env
from nix-env-selector.
It'll help a lot to make the parser better if you would send your nix-shell --run export
output that interpreting wrong.
from nix-env-selector.
Related Issues (20)
- [Feature] Pick up nix environment in tasks HOT 5
- Stuck applying environment HOT 12
- Rustup packages as settings packages HOT 3
- Have the extension output logs in the Output window HOT 4
- Can't make my fhs env work HOT 1
- shell.nix exetubables don't seem to be made available after selecting shell.nix HOT 1
- [Feature]: Support shell.nix files outside of the project directory
- [BUG] Extension don't add package to PATH variable, when some active tabs need any package from shell.nix HOT 4
- "command 'nixEnvSelector.selectEnv' not found" HOT 1
- [Feature]: Support multiroot workspace HOT 2
- C/C++ Support: Can this be used to help generate the c_cpp_properties.json configuration file?
- [Documentation]: Document what `Hit environment` means
- [Feature]: Remember nix environment answer
- [Feature]: VSCode-Remote (SSH) support? HOT 6
- No longer applies shell.nix to integrated terminal? HOT 2
- Extension Development Host does not launch
- Can find packages from nix-shell, but not with nix-env-selector HOT 3
- TypeError when applying nix environment in Remote SSH HOT 3
- [Feature]: VSCodium support HOT 1
- Latest Pylance update brakes python environment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-env-selector.