Flickering and annoying experience during opening `nvim`
Bug description
When I open a directory that has a stored session, this plugin loads the session but the start window opens first. I thought that this issue comes from startify plugin, but I disabled it and the issue is still happening with the default neovim start window. [[see videos below]]
Steps to reproduce
Just open a neovim in a directory with saved session
Expected behavior
To sync load the session
Screen recordings


Environment
- OS: Arch Linux
-` ms@ms-arch
.o+` ----------
`ooo/ OS: Arch Linux x86_64
`+oooo: Host: Precision WorkStation
`+oooooo: Kernel: 5.16.5-arch1-1
-+oooooo+: Uptime: 5 hours, 7 mins
`/:-:++oooo+: Packages: 786 (pacman)
`/++++/+++++++: Shell: zsh 5.8
`/++++++++++++++: Resolution: 1024x768
`/+++ooooooooooooo/` WM: dwm
./ooosssso++osssssso+` Theme: Adwaita [GTK2/3]
.oossssso-````/ossssss+` Icons: Adwaita [GTK2/3]
-osssssso. :ssssssso. Terminal: alacritty
:osssssss/ osssso+++. Terminal Font: Cascadia Mono
/ossssssss/ +ssssooo/- CPU: Intel Xeon W3550 (4) @
`/ossssso+/:- -:/+osssso+- GPU: AMD ATI Radeon X1600
`+sso+:-` `.-/+oso: GPU: AMD ATI Radeon X1600 XT
`++:. `-/+/ Memory: 5020MiB / 7940MiB
.` `/
- Plugins commit hash: 16bc2ff389fa4e6c51d5bdaee39fa308109bf3d7
Not sure if it possible to fix since sessions are sourced after Neovim startup (VimEnter autocmd).
I think you can block execution using so while (session not loaded) loop, and read the session loading status using some variables or read from a file such as /tmp/neovim-session-manager/(random-id), and the random-id will be generated before the while loop and session no loaded is read from this file with this random id. When the aysnc loading is done, some text will be written in that file. Finally, delete the file.
We as programmers can find some indirect workaround, I hope you will find one.
No, this won't work, the problem is that Neovim is loaded first, and then the session. If you have any ideas, please send a PR.