stateful / vscode-runme

DevOps Notebooks Built with Markdown - VS Code extension
https://runme.dev
Apache License 2.0
197 stars 16 forks source link

The Run Cell button does not load User profiles (e.g. ~/.bashrc) after the recent update. #1693

Open forseti opened 2 months ago

forseti commented 2 months ago

Hi Team

The Run Cell button does not seem to load .bashrc after the recent update. Is there anyway to load User profiles or any custom/external ENV vars for each run?

Thanks!

sourishkrout commented 2 months ago

The Run Cell button does not seem to load .bashrc after the recent update.

Hi @forseti, the latest .bashrc should load once you hit Reset Session in the notebook toolbar. What looks like a bug here is a feature of the managed environment store. :-)

Can you confirm that this works for you?

Is there anyway to load User profiles or any custom/external ENV vars for each run?

The same goes for .env.local and .env. We also have plans to support direnv, which, upon authorization, would allow running arbitrary shells and exporting env vars as part of it.

Would that help with your use case?

forseti commented 2 months ago

Hi @sourishkrout

Hi @forseti, the latest .bashrc should load once you hit Reset Session in the notebook toolbar. What looks like a bug here is a feature of the managed environment store. :-) Can you confirm that this works for you?

I tried the Reset Session, but the new and updated ENV vars did not get loaded when I ran any command from the current session, so I had to restart the runtime to make them working again.

I think this is a minor issue for me since I can always include these vars in my scripts.

The same goes for .env.local and .env. We also have plans to support direnv, which, upon authorization, would allow running arbitrary shells and exporting env vars as part of it. Would that help with your use case?

direnv is perfect. Thanks!

sourishkrout commented 2 months ago

I think the issue is that we're forking/seeding the ENV with the systems, which trickles down from the code process. This is something we could do differently. It's good to hear it's a minor issue. I'd have to think about it more to determine what makes most sense.