:h terminal-session it will relaunch a terminal buffer with a session by running the command which was supplied to
:terminal to start with or you can modify it via
Is there a way for a vim session to automatically change to a specific directory, enable a virtualenv and start the server as I am currently doing with tmux?
I do not use
:terminal or such a setup as you do, but I would hazard a guess that you could create a shell/python script which would change your current directory, enable virtualenv, and start your server. Combine it with a custom Vim command to execute it:
command! StartServer execute "terminal start-server.sh " . resolve(expand('%:h'))
In theory doing something like this would allow it restore. That being said if you now have a nice command to start your server, you may not care as much if it restores as you can easily access it.
For more help see: