Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Disable Terminal through 'jupyter_server_config.py` #85

Closed
rprater opened this issue Jul 5, 2023 · 4 comments · Fixed by #91
Closed

Unable to Disable Terminal through 'jupyter_server_config.py` #85

rprater opened this issue Jul 5, 2023 · 4 comments · Fixed by #91
Labels
bug Something isn't working

Comments

@rprater
Copy link

rprater commented Jul 5, 2023

Description

The jupyter server terminal is not disabled on jupyterhub after setting the jupyter_server_config.py like so:

c.ServerApp.terminals_enabled = False

I can confirm that the configuration is acknowledged by the jupyter server by executing the following command jupyter server --show-config which outputs:

...
Loaded config files:
  /Users/rprater/.jupyter/jupyter_server_config.py

ServerApp
  .jpserver_extensions = <LazyConfigValue value={'jupyter_lsp': True, 'jupyter_server_terminals': True, 'jupyterlab': True, 'nbclassic': True, 'notebook_shim': True}>
  .terminals_enabled = False # <--- acknowledged 

Reproduce

python -m venv venv
source venv/bin/activate
pip install jupyterhub jupyterlab notebook
jupyter server --generate-config
# Edit jupyter_server_config file as described above
jupyterhub

Context

I can confirm this issue does not occur if I pin the jupyter_server package to less than version 2.

Looking at the source code this may make sense, the value gets hard coded here.

@rprater rprater added the bug Something isn't working label Jul 5, 2023
@welcome
Copy link

welcome bot commented Jul 5, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

danielzgtg added a commit to danielzgtg/jupyter_server_terminals that referenced this issue Oct 5, 2023
@Wh1isper
Copy link
Contributor

Nice catch!

In version 1.x, terminal-related functionality has not yet been fully separated from the Jupyter server: https://github.com/jupyter-server/jupyter_server/blob/1.x/jupyter_server/serverapp.py#L2048

@lp9052
Copy link

lp9052 commented Jan 9, 2024

by looking at the source code, it does respect the terminal config.

However, I believe it should update termina_avaliable to False instead of just return.

nbclassic actually read this field and will fail to launch if the value is missing.

I know they should have a default value for missing fields(issue raised). But I also believe it should be populated, instead of just missing.

Link to nbclassic issue: jupyter/nbclassic#255

@Wh1isper
Copy link
Contributor

Wh1isper commented Jan 10, 2024

I know they should have a default value for missing fields(issue raised). But I also believe it should be populated, instead of just missing.

Agree, this allows us to be consistent with Jupyter Server 1.x behaviour.

https://github.com/jupyter-server/jupyter_server/blob/1.x/jupyter_server/serverapp.py#L363

EDIT: PR opened #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants