You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There have been two discussions about loss of focus after hitting Ctrl+Enter in Edit mode within a cell: #6337 and #6198 .
However, the behavior is still faulty, compared to Jupyter Notebook / Lab.
Environment data
VS Code version: 1.58.0-insider
Jupyter Extension version (available under the Extensions sidebar): 2021.8.1007436305
Python Extension version (available under the Extensions sidebar): 2021.7.992362372-dev
OS (Windows | Mac | Linux distro) and version: Ubuntu 20.04.2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Jupyter server running: Remote, but runs on localhost
Expected behaviour
Running a cell with Ctrl+Enter should switch to Control mode immediately, before actually executing the cell. After execution of the cell is finished, no mode or focus change should happen whatsoever.
Actual behaviour
Running a cell with Ctrl+Enter lets the cell stay in Edit mode until execution is completed. After execution is finished, it changes to Control mode. This also happens when switching focus to another cell to edit it during computation.
This is extremely frustrating when it leads to random commands being executed because one's in the middle of typing a line of code or navigating around in the cell.
Steps to reproduce:
create a cell with a long running task, e.g.
import time
time.sleep(3)
run the cell using Ctrl+Enter
the cell stays in edit mode
continue editing the cell or another cell while waiting for execution to finish
as soon as the first cell finished execution, the mode is changed to Control mode.
Logs
Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)
Info 2021-07-08 08:47:50: Execute Cells request 1 0
Info 2021-07-08 08:47:50: Execute Cell 0 file:///home/stanley/Development/mwe/vscode/jupyter_cell_focus.ipynb
Info 2021-07-08 08:47:50: Cell Index:0, state:1, exec: 1. User queued cell for execution
Info 2021-07-08 08:47:50: Cell Index:0, state:1, exec: 1. Ready to execute
Info 2021-07-08 08:47:50: Cell Index:0, state:1, exec: 1. Before Execute individual cell
Info 2021-07-08 08:47:50: Cell Index:0, state:1, exec: 1. Start execution
Info 2021-07-08 08:47:51: Cell Index:0, state:3, exec: undefined. Send code for execution
Info 2021-07-08 08:47:51: Cell Index:0, state:3, exec: undefined. Wait for jupyter execution
Info 2021-07-08 08:47:51: �[32mWidget Coordinator sent IPyWidgets_mirror_execute
Info 2021-07-08 08:47:51: �[32mPosting message to Notebook UI
Info 2021-07-08 08:47:51: �[32mWidget Coordinator received IPyWidgets_msg_received
Info 2021-07-08 08:47:51: �[32mWidget Coordinator sent IPyWidgets_msg
Info 2021-07-08 08:47:51: �[32mPosting message to Notebook UI
Info 2021-07-08 08:47:51: Cell Index:0, state:3, exec: undefined. Kernel switching to busy
Info 2021-07-08 08:47:51: Notebook Session status file:///home/stanley/Development/mwe/vscode/jupyter_cell_focus.ipynb # Busy
Info 2021-07-08 08:47:51: Updating preferred kernel for remote notebook 5f553442-05de-4690-9161-ec150af9037c
Info 2021-07-08 08:47:51: Preferred kernel for file:///home/stanley/Development/mwe/vscode/jupyter_cell_focus.ipynb is 5f553442-05de-4690-9161-ec150af9037c
Info 2021-07-08 08:47:51: �[32mWidget Coordinator sent IPyWidgets_msg
Info 2021-07-08 08:47:51: �[32mPosting message to Notebook UI
Info 2021-07-08 08:47:51: �[32mWidget Coordinator received IPyWidgets_msg_received
Info 2021-07-08 08:47:51: �[32mWidget Coordinator received IPyWidgets_iopub_msg_handled
Info 2021-07-08 08:47:51: �[32mWidget Coordinator received IPyWidgets_msg_received
Info 2021-07-08 08:47:51: �[32mWidget Coordinator received IPyWidgets_iopub_msg_handled
Info 2021-07-08 08:47:53: �[32mWidget Coordinator sent IPyWidgets_msg
Info 2021-07-08 08:47:53: �[32mPosting message to Notebook UI
Info 2021-07-08 08:47:53: �[32mWidget Coordinator sent IPyWidgets_msg
Info 2021-07-08 08:47:53: �[32mPosting message to Notebook UI
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Kernel switching to idle
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Jupyter execution completed
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Completed successfully
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Completed successfully & resolving
Info 2021-07-08 08:47:53: Notebook Session status file:///home/stanley/Development/mwe/vscode/jupyter_cell_focus.ipynb # Idle
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. After Execute individual cell 3
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Executed successfully in executeCell
Info 2021-07-08 08:47:53: Updating preferred kernel for remote notebook 5f553442-05de-4690-9161-ec150af9037c
Info 2021-07-08 08:47:53: Preferred kernel for file:///home/stanley/Development/mwe/vscode/jupyter_cell_focus.ipynb is 5f553442-05de-4690-9161-ec150af9037c
Info 2021-07-08 08:47:53: Cell Index:0, state:3, exec: 2. Execution disposed
Info 2021-07-08 08:47:53: �[32mWidget Coordinator received IPyWidgets_msg_received
Info 2021-07-08 08:47:53: �[32mWidget Coordinator received IPyWidgets_msg_received
Info 2021-07-08 08:47:53: �[32mWidget Coordinator received IPyWidgets_iopub_msg_handled
The text was updated successfully, but these errors were encountered:
sfo
added
the
bug
Issue identified by VS Code Team member as probable bug
label
Jul 8, 2021
Thanks for filing a bug. This was an oversight in my implementation of ctrl+enter. Sorry for the trouble caused, should be fixed by Friday's Jupyter extension insiders build.
There have been two discussions about loss of focus after hitting Ctrl+Enter in Edit mode within a cell: #6337 and #6198 .
However, the behavior is still faulty, compared to Jupyter Notebook / Lab.
Environment data
Expected behaviour
Running a cell with Ctrl+Enter should switch to Control mode immediately, before actually executing the cell. After execution of the cell is finished, no mode or focus change should happen whatsoever.
Actual behaviour
Running a cell with Ctrl+Enter lets the cell stay in Edit mode until execution is completed. After execution is finished, it changes to Control mode. This also happens when switching focus to another cell to edit it during computation.
This is extremely frustrating when it leads to random commands being executed because one's in the middle of typing a line of code or navigating around in the cell.
Steps to reproduce:
Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)The text was updated successfully, but these errors were encountered: