jedrzejboczar/possession.nvim

Close session without exiting Neovim

Closed this issue · 4 comments

Sometimes I want to switch projects (sessions) during the same Neovim instance. It could be a convenient feature to allow the user to close the current session without exiting Neovim.

When you need to switch to a different session it should just work if you just PossessionLoad another session. If you set plugins.delete_buffers = true then it will delete all existing buffers before loading the new session. One issue I can think of is that there is no command for when you want to only close the session and not open another one. Is this what you meant? If so, do you think it would be enough to just delete all buffers to "close" the session (and clean up currently loaded session name in possession internally)?

Yes, that's what I meant, just close the session without opening a new one. Sometimes I'll want to switch gears and do something else in Neovim (this sometimes but not always means switching between two sessions), but I don't want to contaminate my opened session with this unrelated work.

Delete all buffers and stop tracking things in the session is what I have in mind. I just want a way to stop tracking the session without restarting Neovim.

With 3ed8437...20ed145 it is now possible via PossessionClose. Please check if everything works as expected.

Yup, all is working. Thanks for the implementation.