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

Set environment variable when running commands #636

Closed
ktbarrett opened this issue Jul 24, 2022 · 1 comment · Fixed by #641
Closed

Set environment variable when running commands #636

ktbarrett opened this issue Jul 24, 2022 · 1 comment · Fixed by #641

Comments

@ktbarrett
Copy link
Contributor

How would this feature be useful?

Setting an environment variable in the environment of session.run'd commands would allow the child process to know it is being executed by nox and perhaps even what session of nox is being. Personally, I would find this useful when session.runing bash or code (using nox as a development environment manager) so that I can adjust my PS1 with the name of the session I'm in.

Describe the solution you'd like

When running any command with session.run, the command environment is adjusted to set the NOX_CURRENT_SESSION variable with the name of the current session.

Describe alternatives you've considered

It's entirely possible to do this myself using env argument to session.run. However it is something innocuous that takes the burden off the user without considerable maintenance effort.

Anything else?

No response

@crwilcox
Copy link
Collaborator

This seems like a nice enhancement and shouldn't be disruptive to folks. I'd be for this.

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

Successfully merging a pull request may close this issue.

2 participants