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
Copy Path and Copy Relative Path commands are only available when editor is not focused. #137216
Comments
Related PR: #137217 @rebornix assigning this issue also to you given the change in #49231. I think the check for //cc @JacksonKearl |
@rebornix - was just wondering if you had any opinions on this - I'm happy to look into alternatives if you have a preferred alternative approach? |
I'll take a look this week and see the impact of merging the PR and decide if having it merged this week or next. |
Experimented with the PR and a couple of variations of
This is a different/bigger issue though for Menu. Our keybindings on menu/toolbars don't present |
@alexdima fyi this is about the fact that a context menus shows a keybinding even though the context does not match. I am pinging you because I see similar issue #40389 which was closed. The commands in question are the "Copy" commands in the tab context menu: The command is registered with a vscode/src/vs/workbench/contrib/files/browser/fileCommands.ts Lines 266 to 278 in cb79d01
And the menu contributed here: vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts Lines 154 to 168 in cb79d01
My question is whether there is something the context menu does wrong or whether we simply do not support I think bottom line, the desired output would be to:
|
This was fun to investigate, learnings:
I decided to go with a chord in that case: As a nice side effect, you can now copy path and copy relative path from within the editor without having to rebind keybindings. |
…tor is not focused. (fix microsoft#137216) (microsoft#158556)
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
cmd + alt + c
) (whilst the editor is focused)I would expect the path to be copied to clipboard but it isn't.
The when clauses in this file, specify that the keybinding is only active when the editor is not focused.
https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/files/browser/fileCommands.ts#L293-L319
I did some digging to see when that when clause was added and found this:
Related change: c88e58f
Which fixed bug: #47947
Originally posted by @alexdima in #47947 (comment)
It looks like the exclusion is correct, but it is a bit confusing for a user as when you right click on a tab, you are shown a command to copy the relative path, but then when you try and use it, it doesn't work. (Editor being focused is probably the most common use case in vscode.)
As an alternative suggestion, perhaps we could use
!findWidgetVisible
as the when clause instead - that would avoid conflicting with the find widget commands but would allow the command to be used in the editor.It also has the advantage that something would always happen, either the path would be copied, or the icon in the find widget would change.
I have created a draft CL with a change that would potentially improve this.
WDYT?
The text was updated successfully, but these errors were encountered: