jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Remove bash-specific assumption

Open dhirschfeld opened this issue 4 years ago • 4 comments

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

dhirschfeld avatar Nov 17 '20 22:11 dhirschfeld

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()
    )

dhirschfeld avatar Nov 17 '20 22:11 dhirschfeld

fyi: https://github.com/jupyter/notebook/pull/5565 is slated for porting to server. We can then amend that to address these items.

kevin-bates avatar Nov 17 '20 23:11 kevin-bates

Hi @dhirschfeld - did you want to take a swing at a PR once #343 is merged?

kevin-bates avatar Nov 19 '20 19:11 kevin-bates

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...

dhirschfeld avatar Nov 19 '20 21:11 dhirschfeld