Microsoft/vscode

Can't keybind escape when renaming a file in explorer view

Open

#174,877 创建于 2023年2月21日

在 GitHub 查看
 (8 评论) (0 反应) (1 负责人)TypeScript (10,221 fork)batch import
bugfile-explorerhelp wanted

仓库指标

Star
 (74,848 star)
PR 合并指标
 (平均合并 11小时 43分钟) (30 天内合并 1,000 个 PR)

描述

Type: Bug

It's not possible to create a keybinding for escape when renaming a file in the Explorer view. It looks like escape is handled first by something else, then processed by the keybindings system, resulting in it being processed twice. First it cancels renaming and removes focus from the input box. Then it is evaluated against the keybindings list and inputFocus is no longer true.

Steps to Reproduce:

  • Add this keybinding
    { "key": "escape", "command": "workbench.action.focusActiveEditorGroup", "when": "!inputFocus" }
  • Focus the Explorer and begin renaming a file
  • Notice the keybinding is executed and focus is moved back to the active editor, even though inputFocus should be true.

With Keyboard Shortcuts Troubleshooting enabled you can see that escape does not trigger a normal keybinding in this situation (when the keybinding above has not been added). This indicates something outside of the normal flow is handling the event and making it impossible to create a user keybinding that is able to avoid being invoked when renaming a file.

VS Code version: Code - Insiders 1.76.0-insider (78cb4eb690930964f4dcddde7c4828bdb5beaabd, 2023-02-20T11:45:27.892Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: Yes

Item Value
CPUs AMD Ryzen 9 5950X 16-Core Processor (32 x 3400)
GPU Status 2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_renderer: enabled_onvideo_decode: enabledvideo_encode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabledwebgpu: disabled_off
Load (avg) undefined
Memory (System) 31.92GB (19.81GB free)
Process Argv --crash-reporter-id 22cf4e37-a96e-4ad9-82f0-8715f8e2bf6e
Screen Reader no
VM 0%
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vsdfh931cf:30280410
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
pyindex848:30611229
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30659908
pythonb192cf:30661257

贡献者指南