You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git - git.stage shortcut loses file list focus #207066
Click ctrl + option + m to stage your selected file
Previously the focus would go to the next item of the list, but now the focus go to the workbench view, which is pretty annoying when you want to do that multiple times in multiple files
I used this shortcut massively last year and a recent update (something like 1-2 moths ago broke it)
Reacted by IvanD, Jaakko Niemensivu, Dongyoung Moon, Artem Sapegin, jmo-staked, Finn Merlett, Carl Bleick, Ola Alsaker, Mikael Stave, Nulo and 9 more
I would like to add that there is also git.stageAll and git.unstageAll which always asks for repo even if there is one in focus, would be nice to have them worked. In that case workflow would be like this:
focus source control view
stage all files or go through every file with up, down and space or enter to review and stage what's needed
unstage some files (if stageAll was used)
ctrl + enter to commit
right now i have to either use mouse or move focus back to "source control view" every time
Likewise I've found the loss of focus behaviour here infuriating - for something so small and easy to fix, this issue as been on and off in vscode for ages. Would love to see it properly addressed
Reacted by Mikael Stave, dannypernik, Eduardo D Sanchez, Lucas Adelino and Leonardo Rick
Leonardo Rick (@LeonardoRick), sorry for not getting back to you on this until now. When you invoke the command using the keybinding, do you have the file that you are staging opened in the editor? I am asking since invoking the git.stage command using a keybinding only works if the file is opened in the editor, since the command does not have access to the selected item in the list.
When you invoke the command using the keybinding, do you have the file that you are staging opened in the editor?
Ladislau Szomoru (@lszomoru) I am not the original author, but yes, I open the file first and invoke the command to stage or unstage it. Here are short videos showing how the behaviors differ.
Until VS Code version 1.85.2:
Screen.Recording.2024-03-11.at.22.30.20.mov
From VS Code version 1.86.0:
Screen.Recording.2024-03-11.at.22.32.12.mov
Reacted by dannypernik, Mikael Stave, Ladislau Szomoru and vivasvan-patel-ev
happy to take this if it's still open. digging in: #201309 removed the general list/tree focus preservation and re-added it explicitly to the explorer (focusNext/focusLast in explorerView), but the scm view never got the equivalent, that's why staging drops focus. i can add the same to the scm tree following your outline: focus the next resource on removal, and the resource group when the last one goes. planning to prefer next over previous (per point about staging in succession) but shout if you'd rather previous, or if you're already on it.
Reacted by Dongyoung Moon
Reacted by dannypernik, c̵̛̥͊ŏ̸̡̼̺̫̥̻͈̞̍͆̏̓́͜͝ͅl̶̬̞͎̖͉̹̝͕̝͖̣̉͆i̶̡̹͈͎̳̞͙͖̾̂̀͑̀͆̑̓̽̉͐͘͘ͅǹ̷̨͍̮̥̹̘͙̗̻̬̬̜̥̮̃̒̈́̽͗̿̍̄̂̏͆͠͝ ẃ̸̝̝̰͋͒i̶̡̹͈͎̳̞͙͖̾̂̀͑̀͆̑̓̽̉͐͘͘ͅl̶̬̞͎̖͉̹̝͕̝͖̣̉͆l̶̬̞͎̖͉̹̝͕̝͖̣̉͆i̶̡̹͈͎̳̞͙͖̾̂̀͑̀͆̑̓̽̉͐͘͘ͅǎ̴̯̀͠m̵̢͕̫̓̔͑̊̈s̴̹̀̎̇͗̍͗̾̋̏̈͐͒̕͠͠ͅ and Finn Merlett
Well, I guess if you want something done, do it yourself 👀
I've just released a VSCode extension, Focus Next On Stage, that adds this functionality back in. I've been using it the past week and it really does improve the experience of staging files. It even lets you prioritise focusing the next file in the current folder (rather than always focusing the next file down) via an optional setting.
Drop an issue on the repo if you have any problems, otherwise - Happy Staging!
Activity
fallenworld1 commentedon Mar 28, 2024
I would like to add that there is also
git.stageAllandgit.unstageAllwhich always asks for repo even if there is one in focus, would be nice to have them worked. In that case workflow would be like this:up,downandspaceorenterto review and stage what's neededctrl + enterto commitright now i have to either use mouse or move focus back to "source control view" every time
LeonardoRick commentedon Oct 11, 2024
Hey! Any updates on this? 😬
It's being a while and I would love to get this fluid behaviour as before.
I wish I had the knowledge to contribute as well. If anyone could provide me some directions I could try digging into it.
Thanks!
dannypernik commentedon Oct 14, 2024
This is important to me too and deserves attention
finnmerlett commentedon Oct 22, 2024
Likewise I've found the loss of focus behaviour here infuriating - for something so small and easy to fix, this issue as been on and off in vscode for ages. Would love to see it properly addressed
SalhiYassine commentedon Nov 3, 2024
Pls fix
[-]git.stage shortcut loses file list focus[/-][+]Git - git.stage shortcut loses file list focus[/+]lszomoru commentedon Dec 17, 2024
Leonardo Rick (@LeonardoRick), sorry for not getting back to you on this until now. When you invoke the command using the keybinding, do you have the file that you are staging opened in the editor? I am asking since invoking the
git.stagecommand using a keybinding only works if the file is opened in the editor, since the command does not have access to the selected item in the list.vivasvan1 commentedon Dec 31, 2024
+1
scintillavoy commentedon Jan 6, 2025
Ladislau Szomoru (@lszomoru) I am not the original author, but yes, I open the file first and invoke the command to stage or unstage it. Here are short videos showing how the behaviors differ.
Until VS Code version 1.85.2:
Screen.Recording.2024-03-11.at.22.30.20.mov
From VS Code version 1.86.0:
Screen.Recording.2024-03-11.at.22.32.12.mov
lszomoru commentedon Jan 23, 2025
Dongyoung Moon (@scintillavoy), thank you very much for the recording. Will look into this and update the issue.
28 remaining items
vivasvan1 commentedon Jul 11, 2025
Fix this bill gates!!
dannypernik commentedon Jul 30, 2025
Ladislau Szomoru (@lszomoru) João Moreno (@joaomoreno) any update here?
LeonardoRick commentedon Oct 12, 2025
Any directions here?? I really miss this
dannypernik commentedon Jan 3, 2026
Ladislau Szomoru (@lszomoru) João Moreno (@joaomoreno) happy new year. Would love to see this fixed in 2026.
dobbydobap commentedon Jul 7, 2026
happy to take this if it's still open. digging in: #201309 removed the general list/tree focus preservation and re-added it explicitly to the explorer (
focusNext/focusLastinexplorerView), but the scm view never got the equivalent, that's why staging drops focus. i can add the same to the scm tree following your outline: focus the next resource on removal, and the resource group when the last one goes. planning to prefer next over previous (per point about staging in succession) but shout if you'd rather previous, or if you're already on it.finnmerlett commentedon Nov 11, 2026
Well, I guess if you want something done, do it yourself 👀
I've just released a VSCode extension, Focus Next On Stage, that adds this functionality back in. I've been using it the past week and it really does improve the experience of staging files. It even lets you prioritise focusing the next file in the current folder (rather than always focusing the next file down) via an optional setting.
Drop an issue on the repo if you have any problems, otherwise - Happy Staging!