I would like to place the focus from an editor buffer into the IPython terminal using only the keyboard.
I see two approaches, but they both do not seem to work.
workbench.action.terminal.focusNext
or something alike using ctrl+backtick
. This seems to be a dead end because all it ever does is shift focus to or activate a terminal in the dedicated terminal buffer at the bottom of all panes. ctrl+{1...n}
to focus on another pane. This works for other editor buffers: I switch the focus to the pane, and the focus goes into the most recent editor buffer. However, this does not work as expected for the IPython terminal: focus does switch to the pane (or group, as it is called in the left vertical side-bar), but does not go into the terminal itself.This really is unfortunate as in my workflow, I often go forth and back between the editor and the terminal. Of course an alternative is to make a cell in the editor and execute that using shift+enter
, but that is less interactive that what I would prefer.
My impression is that the IPython terminal for VSCode is something in-between an editor and a terminal, or that the action is caught in between VSCode and the Jupyter server.
Version info:
Type Ipython inside the terminal window. Then select the line or lines you want to run from the editor window and then click on the Terminal menu at the top of VScode window. One option in the Terminal menu is to "Run Selected Text". This will be run in the Ipython terminal window.
If you have an existing Jupyter Notebook, you can open it by right-clicking on the file and opening with VS Code, or through the VS Code File Explorer.
3.1. To launch Jupyter Notebook App: Click on spotlight, type terminal to open a terminal window. Enter the startup folder by typing cd /some_folder_name . Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.
Assuming your talking about the 'Python Interactive' window, I would recommend adding a feature suggestion/bug to our issues list:
https://github.com/Microsoft/vscode-python/issues
CTRL + 1/2 should switch the focus to the 'Python Interactive' window, but we don't force the input section to have focus at the moment. That's a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With