jupyter_server
jupyter_server copied to clipboard
Remove bash-specific assumption
In the initialize function -l is unconditionally appended to the shell arguments irrespective of whatever shell it is. Since pwsh is available on linux the logic should be updated to account for this.
https://github.com/jupyter/jupyter_server/blob/e3de58b3be9865e25d653d0f47db8d929440d3ab/jupyter_server/terminal/init.py#L18-L27
I think it would also be useful to allow the user to specify whatever arguments they wanted in the SHELL env var and to only append a -l to the default_shell - i.e. something like:
if os.name == 'nt':
default_shell = 'powershell.exe'
else:
default_shell = f"{which('sh')} -l"
shell = settings.get(
'shell_command',
os.environ.get('SHELL', default_shell).split()
)
fyi: https://github.com/jupyter/notebook/pull/5565 is slated for porting to server. We can then amend that to address these items.
Hi @dhirschfeld - did you want to take a swing at a PR once #343 is merged?
Sorry, I'm completely smashed at the moment. I'll try to get to it in the next couple of weeks so if someone else wants to pick it up before then feel free...