microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
159.32k stars 27.87k forks source link

Esc+B works in wrong way with jupyter notebooks if intellisense is ON #212966

Closed ibobak closed 1 week ago

ibobak commented 2 weeks ago

Type: Bug

If I have intellisense window shown, pressing Esc+B works in wrong way: instead of adding a new cell below my one, it will just insert character b.

image

image

image

VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:16:23.416Z) OS version: Linux x64 6.4.6-060406-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 3700X 8-Core Processor (16 x 4180)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|46.95GB (26.04GB free)| |Process Argv|--crash-reporter-id d91c5c25-2c49-4af3-80cb-302636dde5af| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (53) Extension|Author (truncated)|Version ---|---|--- numbered-bookmarks|ale|8.4.0 project-manager|ale|12.8.0 zoomer|ant|0.2.3 vscode-django|bat|1.15.0 docs-view|bie|0.1.0 path-intellisense|chr|2.8.5 gitignore|cod|0.9.0 git-extension-pack|don|0.1.3 githistory|don|0.6.20 python-environment-manager|don|1.2.4 python-extension-pack|don|1.7.0 gitlens|eam|15.0.3 copilot|Git|1.194.0 copilot-chat|Git|0.15.1 vscode-edit-csv|jan|0.9.1 vscode-icon-theme|jtl|1.6.6 vsc-python-indent|Kev|1.18.0 vscode-checkpoints|mic|1.3.3 vscode-docker|ms-|1.29.1 vscode-dotnet-runtime|ms-|2.0.5 black-formatter|ms-|2024.2.0 debugpy|ms-|2024.6.0 pylint|ms-|2023.10.1 python|ms-|2024.6.0 vscode-pylance|ms-|2024.5.1 datawrangler|ms-|1.0.2 jupyter|ms-|2024.4.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.362.0 remote-ssh|ms-|0.110.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.88.2 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.3 remote-server|ms-|1.5.1 vs-keybindings|ms-|0.2.1 one-dark-theme|msk|1.14.2 autodocstring|njp|0.6.1 git-file-history|pom|1.0.1 gpack|Sey|2.0.0 markdown-preview-enhanced|shd|0.8.13 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-conventional-commits|viv|1.25.0 vscode-java-debug|vsc|0.57.0 vscode-maven|vsc|0.44.0 jinja|who|0.0.8 markdown-all-in-one|yzh|3.6.2 material-theme|zhu|3.17.2 vscode-open-in-github|ziy|1.3.6 (10 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 tftest:31042121 vswsl492cf:30256860 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 chatpanelt:31048053 dsvsc021:30996838 9c06g630:31013171 pythoncenvptcf:31043158 a69g1124:31046351 pythonprc:31047982 dwnewjupyter:31046869 ```
rebornix commented 1 week ago

This is as designed as we want to make sure that users can always dismiss the intellisense widget first.

With that said, you can customize this behavior by adding following to your keybindings.json

{
  "key": "escape",
  "command": "notebook.cell.quitEdit",
  "when": "inputFocus && notebookEditorFocused"
}
ibobak commented 1 week ago

Thank you very much for your response.

In my case it was like this:

{
  "key": "escape",
  "command": "notebook.cell.quitEdit",
  "when": "inputFocus && notebookEditorFocused && !editorHasMultipleSelections 
&& !editorHasSelection && !editorHoverVisible && !inlineChatFocused"
}

Configuring VS code is the biggest challenge

May I ask you one question: where is the full lists of possible conditions (inputFocus, notebookEditorFocused, editorHasMultipleSelections, ...) with their meanings? Is there a documentation on all of them?