James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.66k stars 530 forks source link

Delete Synctex On Exit #4136

Closed Obscure2020 closed 9 months ago

Obscure2020 commented 9 months ago

I would like to request a new config option for this extension.

I use the existing options for aggressively cleaning up the working files generated by the compilation process, and I'm satisfied by how that setting works. My experience with this extension has been quite painless, except for one minor point.

When I am finished working on a latex document, have built it one more time to get the most up-to-date PDF, and have closed VSCode, I have no further need of the synctex.gz files. They're useful during editing, but not after editing has concluded. So I always end up deleting them manually.

If I need to open up a file again for further editing later, I can easily regenerate the synctex.gz file to reactivate Synctex functionality. All I have to do is tell VSCode to rebuild. When I'm done editing, though, I'd like it if the Synctex files could be removed automatically.

I propose a new setting that automatically deletes synctex.gz files when I close VSCode.

James-Yu commented 9 months ago

Unfortunately, the extension cannot distinguish between closing vscode and disabling the extension alone. What you need might be a custom bash script that invokes vscode, and deletes the said file on exit.