File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,13 @@ def initialize(nb_app):
2121 shell = nb_app .terminado_settings .get ('shell_command' ,
2222 [os .environ .get ('SHELL' ) or default_shell ]
2323 )
24- # Enable login mode - to automatically source the /etc/profile script
25- if os .name != 'nt' :
24+ # Enable login mode - to automatically source the /etc/profile
25+ # script, but only for non-nested shells; for nested shells, it's
26+ # superfluous and may even be harmful (e.g. on macOS, where login
27+ # shells invoke /usr/libexec/path_helper to add entries from
28+ # /etc/paths{,.d} to the PATH, reordering it in the process and
29+ # potentially overriding virtualenvs and other PATH modifications)
30+ if os .name != 'nt' and int (os .environ .get ("SHLVL" , 0 )) < 1 :
2631 shell .append ('-l' )
2732 terminal_manager = nb_app .web_app .settings ['terminal_manager' ] = TerminalManager (
2833 shell_command = shell ,
You can’t perform that action at this time.
0 commit comments