Closed r10r closed 2 years ago
This line should effectively clean them up:
I can't reproduce, so I'll need a bit more of a clue about the circumstances under which this problem happens.
I've just done an strace, and it seems that the session gets written again. When I disable all other plugins it works as expected.
close(3) = 0
stat("/root/devcontainer/Session.vim.obsession.12567", {st_mode=S_IFREG|0644, st_size=1242, ...}) = 0
stat("/root/devcontainer/Session.vim", {st_mode=S_IFREG|0644, st_size=1242, ...}) = 0
unlink("/root/devcontainer/Session.vim") = 0
rename("/root/devcontainer/Session.vim.obsession.12567", "/root/devcontainer/Session.vim") = 0
mmap(NULL, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fdc27615000
[...]
stat("/root/devcontainer/Session.vim.obsession.12567", 0x7ffda27e3ca0) = -1 ENOENT (No such file or directory)
open("/root/devcontainer/Session.vim.obsession.12567", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
I nailed it down to the coc.nvim
plugin
The only hint regarding sessions in coc.nvim is https://github.com/neoclide/coc.nvim/blob/a2dc06d0d44addf37a8e0d7bf7b4b1258302262a/doc/coc.txt#L1855
I did that push before seeing your most recent comments. Still gonna cross my fingers that it's an effective fix.
That coc.nvim doc is just saying that g:WorkspaceFolders
could end up in the session. It's passive and shouldn't cause an issue like this.
I think you can revert the change. The culprit is the coc plugin coc-lists
Session handling in coc-lists is enabled by default and must be disabled in :CocConfig
with
"session.saveOnVimLeave": "false"
The change will cover a few other possible error conditions so I'll leave it in place. Thanks for sharing your solution.
Thanks for your support!
Hi @tpope
I've just installed the latest version of vim-obsession d2818a614ec3a5d174c6bb19e87e2eeb207f4900 and noticed that the session tmp files of the format
{sessionname}.obsession.{pid}
are not cleaned up.