Closed antoine-galataud closed 2 years ago
I have a use case where I'd like to pass extra environment variables to a new terminal. I would instantiate it using something like:
curl -XPOST'http://localhost:8888/api/terminals' \ -d '{"extra_env": {"VAR1": "value1", "VAR2": "value2"}}'
and this would propagate env vars to the created terminal.
I guess it could be done the same way than for extra_env dict that is a class field of TermManagerBase (hence can't be used in my specific case).
extra_env
TermManagerBase
For instance here: https://github.com/jupyter/terminado/blob/ad8b9bbfd559c3b56b0708ce2c22666fdf0b5ca6/terminado/management.py#L189-L190 could be followed by
term_env = kwargs.get("extra_env", {}) if term_env and isinstance(term_env, dict): _update_removing(env, term_env)
(making terminal env supersede manager-scoped env)
Makes sense to me, happy to accept a PR!
I have a use case where I'd like to pass extra environment variables to a new terminal. I would instantiate it using something like:
and this would propagate env vars to the created terminal.
I guess it could be done the same way than for
extra_env
dict that is a class field ofTermManagerBase
(hence can't be used in my specific case).For instance here: https://github.com/jupyter/terminado/blob/ad8b9bbfd559c3b56b0708ce2c22666fdf0b5ca6/terminado/management.py#L189-L190 could be followed by
(making terminal env supersede manager-scoped env)