Fixes a problem with leftover tmp session files. Issue happens after changing/adding buffers/tabs and toggling Obsession (to pause/unpause session tracking). The folder looks like this after a couple of runs (see below, played only with Neovim 0.8). Issue is caused by the mksession call automatically changing the v:this_session variable after writing the tmp session file. Solution is to restore the v:this_session variable after the mksession call.
Fixes a problem with leftover tmp session files. Issue happens after changing/adding buffers/tabs and toggling Obsession (to pause/unpause session tracking). The folder looks like this after a couple of runs (see below, played only with Neovim 0.8). Issue is caused by the mksession call automatically changing the v:this_session variable after writing the tmp session file. Solution is to restore the v:this_session variable after the mksession call.
$ ll Session.vim*
Session.vim.1661.obsession~
Session.vim.1767.obsession~
Session.vim.23502.obsession~
Session.vim.24782.obsession~
Session.vim.24782.obsession~.24782.obsession~.24782.obsession~
Session.vim.24782.obsession~.24782.obsession~.24782.obsession~.24782.obsession~ Session.vim.28396.obsession~
Session.vim.29727.obsession~
Session.vim.31061.obsession~
Session.vim.3134.obsession~
Session.vim.3134.obsession~.3134.obsession~
Session.vim.32691.obsession~
Session.vim.378.obsession~
Session.vim.4539.obsession~