File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1488,10 +1488,18 @@ def _default_allow_remote(self) -> bool:
14881488 """
14891489 ),
14901490 )
1491+
14911492 terminado_settings = Dict (
1492- Union ([List (), Unicode ()]),
1493+ per_key_traits = {
1494+ "shell_command" : Union (
1495+ [List (), Unicode ()], help = "The shell command to execute in the terminal."
1496+ ),
1497+ "extra_env" : Dict (
1498+ Unicode (), help = "Extra environment variables to set in the terminal."
1499+ ),
1500+ },
14931501 config = True ,
1494- help = _i18n (' Supply overrides for terminado. Currently only supports "shell_command".' ),
1502+ help = _i18n (" Supply overrides for terminado." ),
14951503 )
14961504
14971505 cookie_options = Dict (
Original file line number Diff line number Diff line change @@ -297,6 +297,17 @@ def test_shell_command_override(
297297 assert app .web_app .settings ["terminal_manager" ].shell_command == expected_shell
298298
299299
300+ def test_terminal_extra_env_override (jp_configurable_serverapp ):
301+ config = Config ({"ServerApp" : {"terminado_settings" : {"extra_env" : {"PS1" : "jupyter> " }}}})
302+
303+ app = jp_configurable_serverapp (config = config )
304+ terminado_settings = getattr (app , "terminado_settings" , {})
305+
306+ assert "extra_env" in terminado_settings
307+ assert "PS1" in terminado_settings ["extra_env" ]
308+ assert terminado_settings ["extra_env" ]["PS1" ] == "jupyter> "
309+
310+
300311def test_importing_shims ():
301312 with warnings .catch_warnings ():
302313 warnings .simplefilter ("ignore" )
You can’t perform that action at this time.
0 commit comments