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

Jupyter lab terminals do not remember history #16045

Closed
fzyzcjy opened this issue Mar 23, 2024 · 5 comments
Closed

Jupyter lab terminals do not remember history #16045

fzyzcjy opened this issue Mar 23, 2024 · 5 comments
Labels
bug pkg:terminal status:Answered The issue has been answered by a community member. status:Needs Triage Applied to new issues that need triage

Comments

@fzyzcjy
Copy link

fzyzcjy commented Mar 23, 2024

Description

Hi thanks for the tool! However, the terminal does not seem to remember command history.
For example, open terminal 1 and input command A, then open terminal 2 and the history of "command A" will not be found. The terminal 1 needs to be closed in order to let later terminals see its history.

By the way, as a side question, where is the command history file stored? I am using jupyter's official docker stack, thus would be great to know that folder and mount to host to avoid losing history between restarts.

Reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error '...'

Expected behavior

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@fzyzcjy fzyzcjy added the bug label Mar 23, 2024
Copy link

welcome bot commented Mar 23, 2024

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! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Mar 23, 2024
@krassowski
Copy link
Member

For example, open terminal 1 and input command A, then open terminal 2 and the history of "command A" will not be found. The terminal 1 needs to be closed in order to let later terminals see its history.

This is down to specific terminal shell that you use. This is a typical behaviour of a bash shell history, nothing to do with JupyterLab itself.

By the way, as a side question, where is the command history file stored? I am using jupyter's official docker stack, thus would be great to know that folder and mount to host to avoid losing history between restarts.

This is a question best answered by https://github.com/jupyter/docker-stacks but the answer will likely depend on whether you use the default terminal shell, or customize it, and have little to do with Jupyter itself but more with the shell of choice.

@fzyzcjy
Copy link
Author

fzyzcjy commented Mar 25, 2024

I see: Now there is .bash_history. Originally I got confused because I started a brand new container, and since the terminal does not write to bash history before closing, there is no such file... Thanks!

So to confirm, do I understand correctly: JupyterLab does nothing special, but just uses the system's normal shell?

@JasonWeill
Copy link
Contributor

@fzyzcjy On Linux, this is generally true; JupyterLab uses whichever shell you've chosen to use.

@JasonWeill JasonWeill added the status:Answered The issue has been answered by a community member. label Mar 26, 2024
@fzyzcjy
Copy link
Author

fzyzcjy commented Mar 26, 2024

Thank you!

@fzyzcjy fzyzcjy closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg:terminal status:Answered The issue has been answered by a community member. status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

3 participants