'View: Toggle References' keyboard shortcut toggles 'Terminal' view rather than 'References' view
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.97.2
- OS Version: Windows 11
Steps to Reproduce:
- Go to 'Keyboard Shorcuts'
- Find 'View: Toggle References' and designate a key binding
- Invoke the binded key
- 'Terminal' view is toggled rather than 'References' view
This works as expected for me. What keybinding are you setting it to? Also this command is contingent on the view being available... meaning you need to have requested references at least once in your session, otherwise you get this:
I've put it to ctrl + alt + u. Still the same
Even though I've already made my Reference View referenced for first time,
VSCode redirects me to Terminal (in my case it's Ctrl + Z)
It looks like the issue is caused by one of your installed extensions. All extensions execute together on a single nodejs process, so in order to narrow down the possible problematic extension, please try the following:
- run
F1 > Help: Start Extension Bisect - (this will restart VS Code with half of your extensions disabled)
- try to do the steps which reproduce the problem
- if the problem reproduces, click "This is bad" (this narrows down the problematic extension to the half which was enabled)
- if the problem does not reproduce, click "Good now" (this narrows down the problematic extension to the half which was disabled)
- these steps will repeat until the problematic extension is found
| initial | step | final |
|---|---|---|
![]() |
![]() |
![]() |
Tried it multiple times but it seems the same. For me, the options were "I can't reproduce" "I can reproduce"
It was always the same. Should I share my keybindings here?
Yes, share your keybinding. Also if you run this command:
Developer: Toggle Keyboard Shortcuts Troubleshooting
and share the log that opens up, that will help us understand what command is being fired for your keybinding.
It seems to be running the correct command:
2025-03-09 00:30:39.317 [info] [Window] [KeybindingService]: / Received keydown event - modifiers: [ctrl,alt], code: KeyU, keyCode: 85, key: u
2025-03-09 00:30:39.317 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,alt], code: KeyU, keyCode: 51 ('U')
2025-03-09 00:30:39.317 [info] [Window] [KeybindingService]: | Resolving ctrl+alt+U
2025-03-09 00:30:39.317 [info] [Window] [KeybindingService]: \ From 1 keybinding entries, matched workbench.view.extension.references-view, when: no when condition, source: user.
2025-03-09 00:30:39.317 [info] [Window] [KeybindingService]: + Invoking command workbench.view.extension.references-view.
Have you moved the References View from its default location maybe?
The Reference is on the bottom pane as a single tab it still keeps going to Terminal when I invoke the key
What I observed is that for key mappings that I made for toggling workbench views, I can see the key mapped when I hover over the tab. For example 'Search' has Search (Ctrl +Alt +F) while 'Reference' doesn't
It's strange how it also invokes the Terminal toggle rather than not doing anything
ok I found out that the References workbench gets toggled when I change the keybinding of references-view.tree.toggleVisibility.
However, This only gets invoked once I have the References view focused with results.
For example, if I am focused somewhere else and invoke the references-view.tree.toggleVisibility command, it does nothing
Strange thing also is when the command works, the workbench toggles between User View Container and References
Aside of all that, I don't know why the View: Toggle References still toggles my terminal window (this seems to be a different issue)
Ok, so I can reproduce this... If I have not yet asked for references so the References View is NOT visible, then running the keybinding that is set to workbench.view.extension.references-view does show the Terminal for some reason.
However, if I ask for references via "Find All Reference" (alt+shift+F12 for me)... then the References view shows up. At this point, calling workbench.view.extension.references-view with my keybinding does work as expected.
https://github.com/user-attachments/assets/8bc851b8-0326-43d3-9b59-1d7996ec7f6a
I'll admit opening the terminal is odd... but there are no references that have been requested yet. What would you want to happen? It just shows an empty references screen? Or would the "References: Find All References" be more of what you're looking for?
@TylerLeonhardt so I reported this issue since I thought it wasn't behaving as I expected. Most of the View: Toggle XYZ keybindings, when I invoke it, if the View is opened, it closes and if it is closed, it opens back. (Try View: Toggle Explorer) behavior.
I realized this since I memorize shortcuts for Views that I often visit (Search, Explorer, Copilot Chat etc) and invoke it so that I can close it if it's opened when I don't need it, or vice versa.
The View: Toggle References, I was expecting the same
The problem is that the references view doesn't actually exist yet.
View: Toggle XYZ works for other views like the Explorer because the view is loaded (it is either hidden or visible... but it exists)
The References view doesn't actually exist until you request references. That's why there's different behavior.
Once the References view has been created by asking for references for something, then the keybinding works.
Is this what you experience as well?
https://github.com/user-attachments/assets/49edc87a-e8e7-41bc-8eff-100c0c341b43
so my expected behavior is just like any other View: Toggle XYZ command.
invoke shortcut, and hide if open and open if hide
I've attached the video on how it works only when Reference view is first initiated, but goes to the Terminal if I hit the hot key
@fsw0422 can you enable >Developer: Toggle Screencast Mode in the Command Palette and re-record so I can see the keystrokes & Commands that are getting run?
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
https://github.com/user-attachments/assets/1b4264d5-8061-47f4-810c-2a3b7217c024
@TylerLeonhardt here's the new recorded version with screencast mode on
Thanks for providing that @fsw0422 the video makes it clear. It's unusual to me that the toggleVisibility for the references view defined here:
https://github.com/microsoft/vscode/blob/f5e083907431d34249f6ac8cd5cf0d1d92dbae26/src/vs/workbench/services/views/browser/viewDescriptorService.ts#L780-L809
shows the terminal after running it. Passing to the owner of this code. @sandy081 I was able to repro this behavior, let me know if it's unclear.
@TylerLeonhardt Since you are able to repro, can you please share steps to reproduce. Thanks/
@sandy081 steps to reproduce
- Goto 'Keyboard Shortcuts'
- Search for 'View: Toggle References'
- Set a keybinding (I've set mine to ctrl +alt + h)
- Execute any action that will initiate the openeing of the 'Reference' Container in Panel (for me I just invoked 'find usage' on a python method in my code)
- Set your focus back to anywhere like the code editor
- Invoke the keyboard shortcut you've set in '2.'
It focuses back to Terminal
Followed these steps and for me this is toggling the visibility of the view as expected because the View: Toggle References is to toggle the visibility of the view. If you want to assign a keyboard shortcut to focus the view assign it for references-view.tree.focus command
@sandy081 did you watch this screencast?
the issue is that it is "not" toggling the reference view but opening a terminal view
I tried the steps you shared. It would be helpful to share the exact steps instead of screencast.
https://github.com/microsoft/vscode/issues/242275#issuecomment-2784570648
This is exactly the steps that I've followed and the screencast is the result and proof of it
Are there more info that I can provide?
@fsw0422 I cannot reproduce the behaviour with your steps mentioned above. In your steps, you have not mentioned that the references view is in a different location. Please note that these details are important in repro steps. I have followed the video and I still cant repro. May I know if you have conflicting keybindings for ctrl +alt + h
https://github.com/user-attachments/assets/39608ea5-8894-4d10-a371-5ed1c3057d8e
@sandy081 indeed very weird. The location of reference is the same as your's (as you see in my video, the container is right next to the search container)
Fun fact. I just realized ctrl + alt + k does the same, switching to Terminal which I mapped for View: Toggle Bookmarks (for the Bookmarks plugin)
Attaching my settings if it helps
I see ctrl + alt + k is assigned to Bookmarks and not for references. But you reported the issue for References. Am U missing anything here?
@sandy081 both ctrl + alt +k (mapped to view bookmarks) and ctrl + alt + h (mapped to view reference) are toggling Terminal
Unfortunately, I am not able to reproduce this behaviour. Can you please try to reproduce in a fresh profile (You can create an empty profile in VS Code - F1 > Open Profiles UI) and add only ctrl + alt + h keybinding and see if you can repro?
@sandy081 please close this issue. I've just manged to use Focus Container View


