vscode
vscode copied to clipboard
Add a command-line argument to prevent an opened file/directory from being included in VS Code's recent files list
I use a script to automate the marking process when I assess work created by my students. This script:
- Git clone's their work to a temporary directory
- Checks out their latest commit to
mainbefore the assignment deadline - Displays their student info
- Launches VS Code to show their work and waits for it to exit
This works fine, but after finishing marking, I'll have tens of entries to remove from my history, which is incredibly annoying.
Looks like I have some spring cleaning to do
I wish there was a command-line argument I could use to prevent the file from being added to VS Code's history. Perhaps something like:
code /tmp/tmp.5oCctPYt8z -nw --no-history
Currently, I have tried to make my script modify VS Code's history to filter out the directories it opened, but this has been ineffective, and is a large maintenance burden due to the frequently-changing database structure.
Alternative solutions
- Add a setting to allow me to specify directories that shouldn't appear in VS Code's history. This would require a little more manual effort for users of my script, but is acceptable.
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
This is already possible today: just add --skip-add-to-recently-opened.
https://github.com/microsoft/vscode/blob/e75b1768984cdc056743a7793dbc2e0787cc983b/src/vs/platform/environment/node/argv.ts#L180
@bpasero it's great that this option exists, but it appears to be entirely undocumented. Notably, I was not able to find documentation in:
- The online reference
- The help shown in
code --help
Can this feature (and perhaps any other missing flags) be documented please? I'd hate for others to encounter the same struggles as me.
Opened https://github.com/microsoft/vscode-docs/issues/9049