feat: add support for forwarding the entire env - #425
Merged
Merged
Conversation
ethanpailes
force-pushed
the
add-forward-all-env
branch
2 times, most recently
from
September 2, 2026 21:09
5f24f49 to
bd69589
Compare
maxhbooth
approved these changes
Sep 10, 2026
| .filter(|(var, _)| local_env_keys.contains(var.as_str())) | ||
| .collect(), | ||
| }; | ||
| info!( |
There was a problem hiding this comment.
even though this is just the keys, maybe it'd be better to make this debug verbosity? I'm not sure how sensitive that is or not, tbh.
Contributor
Author
There was a problem hiding this comment.
good point, switched to debug.
| let forward_env = self.config_manager.get().forward_env.clone(); | ||
| let mut local_env_keys = vec!["TERM", "DISPLAY", "LANG", "SSH_AUTH_SOCK"]; | ||
| if let Some(fenv) = &forward_env { | ||
| let mut local_env_keys = HashSet::with_capacity(4); |
There was a problem hiding this comment.
nit: I think you could move the default keys and the full env implementations into the local_env match below and it'd be a little cleaner.
Contributor
Author
There was a problem hiding this comment.
good point, switched.
This patch extends the forward_env config option so that you can write ``` forward_env = true ``` in addition to setting up a fixed list of variables to forward. With this setting enabled, all variables present in the shell that `shpool attach` was launched from will be forwarded. Additionally, you can put ``` forward_env = false ``` to completely disable env var forwarding. Currently, we have a small handful of variables that we forward by default, so this new false setting allows users to fully prevent them being forwarded if they so desire. Fixes #241
ethanpailes
force-pushed
the
add-forward-all-env
branch
from
September 10, 2026 20:30
bd69589 to
53bf406
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link
#241
AI Policy Ack
Ack
This PR was:
Description
This patch extends the forward_env config option so that you can write
in addition to setting up a fixed list of variables to forward. With this setting enabled, all variables present in the shell that
shpool attachwas launched from will be forwarded.Additionally, you can put
to completely disable env var forwarding. Currently, we have a small handful of variables that we forward by default, so this new false setting allows users to fully prevent them being forwarded if they so desire.
Fixes #241