question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No focus when entering a Jupyter Notebook tab

See original GitHub issue

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Open a tab with a .ipynb file with some cells (Python extension must be installed)
  2. move a bit around: pressing j you select the next cell
  3. now move the focus away from the tab and put it back in to the notebook tab, for instance press twice CMD+` in macOS to show and hide the terminal.
  4. now you would expect to be able to interact with the notebook with the keyboard, for instance pressing k you would expect to select the cell above, but nothing happens
  5. to restore the focus you have to click with the mouse in one cell

Actual behavior

Once going away from a .ipynb tab and going back in the focus is lost and you have to use click with the mouse to restore the focus

Expected behavior

Focus should be on the notebook, as what it happens with any source code tab.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local | Remote | N/A
  • Extension version: 2020.4.74986
  • VS Code version: March 2020 (version 1.44)
  • Setting python.jediEnabled: false
  • Python and/or Anaconda version: Python 3.7.6
  • OS: Mac 10.15.3
  • Virtual environment: conda

Developer Tools Console Output

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
surajxcommented, May 27, 2020

Same issue here. I should emphasize that any action that moves focus away from the tab causes this issue.

  • Jupyter server running: Local
  • Extension version: 2020.5.80290
  • VS Code version: 1.45.1
  • jediEnabled: true
  • Python version: Python 3.8.2
  • OS: Ubuntu 20.04
  • Virtual environment: virtualenv

Further observations: if you are in a markdown cell, Alt+Tab away from vscode makes the notebook to go into command mode, and need to click the cell to make it editable. This does not happen when in a code cell.

0reactions
greazercommented, Jun 6, 2021

Thanks for your feedback. This issue will be addressed once VS Code adds native support for editing notebooks. Please see https://github.com/microsoft/vscode/issues/91987. You can experiment by using VS Code insiders, which defaults to the new notebook experience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No focus when entering a Jupyter Notebook tab #1616 - GitHub
Workaround to restore focus without using the mouse: Tab , then Enter restores the focus to the notebook after switching back to that...
Read more >
jupyter notebook - Tab does not tab and lets me out the code
On the bottom right in the status bar it will say "Tab Moves Focus". Press ctrl + m .
Read more >
Optimizing Jupyter Notebook: Tips, Tricks, and nbextensions
Alt + Enter run the current cell, insert below; Ctrl + S save and checkpoint. Shortcuts when in edit mode: Esc take you...
Read more >
tabs no longer visible in JupyterLab - Google Groups
I have the tabs menubar open showing that there is a notebook tab and a text editor tab. However there are no tabs...
Read more >
How to enable Autocompletion in Jupyter Notebook application
This article demonstrates how to enable Python/Jupyter application coding autocompletion feature. The demo application uses content from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found