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

Go to symbol in workspace shortcut in Codespaces (browser) is CTRL-T. #232381

Open
mitchdenny opened this issue Oct 28, 2024 · 8 comments · May be fixed by #234243
Open

Go to symbol in workspace shortcut in Codespaces (browser) is CTRL-T. #232381

mitchdenny opened this issue Oct 28, 2024 · 8 comments · May be fixed by #234243
Assignees
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities quick-open Quick-open issues (search, commands)
Milestone

Comments

@mitchdenny
Copy link
Member

Keyboard shortcut for Go to symbol in workspace is CTRL-T. But in codespaces context (in a browser) this opens a new browser tab. So there probably needs to be an alternative default in this hosting scenario.

Version: 1.94.2
Commit: 384ff73
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Embedder: codespaces

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Oct 30, 2024

This is a tricky one... and near impossible to sort out. You can see we've tried to sort this for other things:
https://code.visualstudio.com/docs/editor/vscode-web#_keybindings

I'm open to suggestions if you come up with a good keybinding that:

  • Isn't in use already
  • Plays nice with browser

Some maybe less than ideal workarounds:

  • on macOS, cmd+p does seem to open the Quick Open so maybe on Windows ctrl+P works?... which from there you could type # to get to the Workspace Symbols.
  • Or, there's also the search.quickOpen.includeSymbols setting which will include symbols in the Quick Open results.

@TylerLeonhardt TylerLeonhardt added help wanted Issues identified as good community contribution opportunities feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors quick-open Quick-open issues (search, commands) labels Oct 30, 2024
@TylerLeonhardt TylerLeonhardt added this to the Backlog milestone Oct 30, 2024
@mdayanabbas
Copy link

mdayanabbas commented Nov 1, 2024

Hey to address this issue, i want to introduce a new keyboard shortcut such as : Ctrl+Shift+Alt+T. This shortcut will be specifically designed for VS Code's web environments, ensuring seamless navigation within our codebase without any browser interference.

For a quicker alternative, we can also use the Ctrl+K T shortcut. This shorter sequence provides a convenient way to access the same functionality.

feel free to add any suggestions or lets discuss the approach.

@ashutosh-013
Copy link

how would i like to work on this issue

@akaday
Copy link

akaday commented Nov 8, 2024

Suggestion for a New Shortcut
Choose an Unused Combination: Propose a keyboard shortcut that is unlikely to conflict with browser or other common shortcuts. For example:

Ctrl+Shift+Alt+T: This combination is comprehensive and avoids conflicts but might be a bit cumbersome.

Ctrl+K T: A more compact and user-friendly alternative that is easy to remember and use.

Steps to Implement the Suggestion
Update Keybinding Configuration:

Open the keybindings.json file in Codespaces.

Add or update the keybinding for the "Go to symbol in workspace" command.

Example configuration:

json
{
"key": "ctrl+shift+alt+t",
"command": "workbench.action.gotoSymbol",
"when": "editorTextFocus"
}
Or:

json
{
"key": "ctrl+k t",
"command": "workbench.action.gotoSymbol",
"when": "editorTextFocus"
}
Test the New Shortcut: Ensure that the new shortcut works as expected without conflicting with any browser or other VS Code shortcuts.

Documentation and Communication:

Document the change in the project’s README or relevant documentation files.

Communicate the change with the community or team to ensure everyone is aware of the new shortcut.

@kshashikumar
Copy link

kshashikumar commented Nov 8, 2024

Can we use CTRL + ALT + T instead, which more aligns with the same key in electron app ?

Example Configuration for codespaces
json
{
"key": "ctrl+alt+t",
"command": "workbench.action.gotoSymbol",
"when": "editorTextFocus"
}

@akaday
Copy link

akaday commented Nov 8, 2024

That's a great suggestion! Using CTRL + ALT + T can indeed provide a consistent experience across both the web and Electron app versions of VS Code.

Example Configuration for Codespaces
Here is how you can add this keybinding configuration to your keybindings.json in Codespaces:

json
{
"key": "ctrl+alt+t",
"command": "workbench.action.gotoSymbol",
"when": "editorTextFocus"
}
Steps to Implement the New Keybinding:
Open Keyboard Shortcuts (JSON):

Press CTRL + K followed by CTRL + S to open the Keyboard Shortcuts editor.

Click on the icon in the top-right corner to open keybindings.json.

Add the Custom Keybinding:

Paste the JSON configuration above into your keybindings.json.

Save the File:

Save the keybindings.json file to apply the new keybinding.

By implementing this new shortcut, you should have a more seamless and consistent experience when using the "Go to symbol in workspace" command in Codespaces.

@codewithunknown
Copy link

codewithunknown commented Nov 18, 2024

Hello @TylerLeonhardt,
Currently, the default shortcut for Go to Symbol in Workspace is Ctrl + T, which causes issues in browsers as it opens a new tab.
I'm considering changing the default shortcuts to:

  • Ctrl + Alt + T (Windows)
  • Control + Option + T (Mac)

Do you have any suggestions or alternative approaches?

Should I proceed with this implementation? Also, if you don't mind, could you please point me to the specific file where this change needs to be made? I tried searching for Ctrl + T but am having difficulty locating the exact file to modify.

Image

@TylerLeonhardt
Copy link
Member

@codewithunknown try searching for the command instead of the keybinding.

I think this looks like a reasonable choice for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities quick-open Quick-open issues (search, commands)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants