While using :mksession
feature, I found that it works well with files and netrw
, but not so much with neovim terminal
windows. The problem is that, for terminal, it never preserves working directory inside the shell, even if I :lcd
before saving the session. It does restore working directory inside vim
itself, but the shell directory is always the one that was specified when terminal was created.
I'm wondering if there's a way to work around this. I'm thinking about something like calling extra function after session restore to run cd getcwd()
in every terminal window, but I'm not sure how to do it correctly.