Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using key chord when file tree is focused triggers file highlighting #68171

Closed
pedro-pedrosa opened this issue Feb 7, 2019 · 15 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tree-widget Tree widget issues verified Verification succeeded
Milestone

Comments

@pedro-pedrosa
Copy link

Issue Type: Bug

When focusing the file tree pane, hitting the "Save all" chord Ctrl+K-S triggers the file highlighting feature when the S key is pressed, making it impossible to use the chord.

VS Code version: Code 1.31.0 (7c66f58, 2019-02-05T22:35:56.624Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz (8 x 2394)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.89GB (1.75GB free)
Process Argv
Screen Reader no
VM 50%
Extensions (3)
Extension Author (truncated) Version
tslint eg2 1.0.42
csharp ms- 1.17.1
vscode-docker Pet 0.5.2
@vscodebot
Copy link

vscodebot bot commented Feb 7, 2019

@kieferrm
Copy link
Member

kieferrm commented Feb 7, 2019

As a temporary work-around you can disable highlight/filtering in the tree. Change the setting Workbench > List: Keyboard Navigation to simple or in json:

"workbench.list.keyboardNavigation": "simple"

@joaomoreno
Copy link
Member

joaomoreno commented Feb 8, 2019

@pedro-pedrosa I can only reproduce if the workbench.list.keyboardNavigation is set to simple. Do you by any chance have that configuration?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Feb 8, 2019
@pedro-pedrosa
Copy link
Author

Currently set to highlight.

"workbench.list.keyboardNavigation": "highlight"

Anything else you'd like me to check?

@pedro-pedrosa
Copy link
Author

If I change it to simple it both triggers the chord and selects a file. If I change it to filter, it doesn't trigger the chord and starts filtering the file tree, same behaviour as highlight.

@IllusionMH
Copy link
Contributor

IllusionMH commented Feb 8, 2019

I'm able to reproduce this issue in latest Insiders build.

  1. Click on any file in Explorer
  2. Press Ctrl + K - status bar shows (Ctrl + K) was pressed waiting for second key of chord...
  3. Press any key - it is added to highlight, status bar still shows (Ctrl + K) was pressed waiting for second key of chord...

I have "workbench.list.keyboardNavigation": "highlight" in settings.

If I switch it to "simple" than I see next behavior:

  1. Press Ctrl + K - status bar shows (Ctrl + K) was pressed waiting for second key of chord...
  2. Press s - all edited files saved, status bar is cleared and file/folder starting with s is focused

VS Code version: Code - Insiders 1.32.0-insider (1c50a87, 2019-02-08T06:16:17.233Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.88GB (18.29GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none

@avxkim
Copy link

avxkim commented Feb 11, 2019

I've noticed one more thing:

  1. If i focus terminal window, and press ⌘K, ⌘S - nothing happens, even if i just press ⌘K i don't see the message ⌘K was pressed waiting for second key of chord..., but if i press ⌘R, then i see the message i mentioned above, but ⌘R, Shift+R doesn't work.
  2. if i focus editor window itself, then all keybindings do work.
  3. if i focus explorer window, then ⌘K, ⌘S work, but ⌘R, Shift+R doesn't work, it instead highlighting the root folder:

image

@avxkim
Copy link

avxkim commented Feb 11, 2019

Just checked my keybindings:

image

As you can see, the When column is empty, so it means these keybindings should fire independent of focused area, e.g. text editor, terminal, explorer. Clearly a bug in 1.31 version.

@alexdima
Copy link
Member

alexdima commented Feb 11, 2019

I can confirm. Steps:

  • define new keybinding, e.g.:
{
    "key": "ctrl+k s",
    "command": "actions.find"
}
  • focus the explorer
  • press ctrl+k
  • the first part of the chord is entered
  • press s
  • the tree begins to highlight 's'.

image


The workaround provided by kieferrm works for me, which is to define in settings.json:

"workbench.list.keyboardNavigation": "simple"

As @pedro-pedrosa and @IllusionMH note, pressing s for example will trigger the chord and move the focus in the explorer to the first element with s.


@heihachi88 Please create a separate issue regarding the terminal. For the explorer, please try the workaround "workbench.list.keyboardNavigation": "simple"

@avxkim
Copy link

avxkim commented Feb 12, 2019

"workbench.list.keyboardNavigation": "simple - it's just a workaround? Things won't change in the future regards this setting?

@pedro-pedrosa
Copy link
Author

Disabling features is not a workaround.

@alexdima alexdima removed the info-needed Issue requires more information from poster label Feb 13, 2019
@joaomoreno joaomoreno added this to the February 2019 milestone Feb 18, 2019
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug tree-widget Tree widget issues labels Feb 18, 2019
@joaomoreno
Copy link
Member

I can repro this on Windows, but not on macOS and Linux.

@joaomoreno
Copy link
Member

joaomoreno commented Feb 21, 2019

@alexandrudima Check out what I get with Ctrl K.

image

Ctrl-F17?! 🤔 Investigating...

@joaomoreno
Copy link
Member

@alexandrudima Found the issue. I was passing a raw KeyboardEvent to softDispatch which was resolving to that ctrl+F17 keypress. As soon as I wrapped it around StandardKeyboardEvent, I got the correct behavior:

image

I'll close this with that fix... but you might want to look into it.

@alexdima
Copy link
Member

@joaomoreno That is crazy, I didn't realize TS would find those to be compatible... Thanks for the heads up. I've pushed 2ff5d6b which makes it more obvious and found another bad usage :/ 2ff5d6b#diff-2203e613237f08bd954dd0a758dfffb4R360

sandy081 pushed a commit to vldmrkl/vscode that referenced this issue Feb 22, 2019
sandy081 pushed a commit to vldmrkl/vscode that referenced this issue Feb 22, 2019
@jrieken jrieken added the verified Verification succeeded label Feb 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tree-widget Tree widget issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants