-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't restore sessions with terminal buffers #391
Comments
Thanks for reporting the issue. I tried reproducing with your config files but I'm not getting any errors when restoring session with terminal as indicated in the repro steps. Can you post the contents of the session file: |
I deleted that session but I can give you another one with the same bug.
|
Hmm, nothing is jumping out to me in that file (there are some Can you answer the following to see if that helps us figure out what might be going on:
thanks for the help! |
1
Contents:
2Building the lastest version of neovim fails on my distro so I don't think I can sorry.
3Yes when I use
4I use these keymaps but I don't have anything that would enter terminal mode on startup.
5See 3 6No, probably because the problem only happens when I use |
That's very helpful! 3. Is a bug with the fallback if Telescope is not being used. Great find; I'll get that fixed. 6. This was the key that helped me reproduce and figure out how to fix the problem. It looks like there's some issue loading the session with a terminal from the Fzf ui. One interesting data point is that Fzf ui windows also seem to be in terminal mode: I can't tell if the error is talking about the Fzf window or the terminal window from the session. It only happens when using Fzf for the picker and the session being loaded has a terminal window in it. One possible explanation is that some state is trying to be restored for the "terminal" window and it's getting confused with the Fzf picker still being up. The fix/work around is to just defer loading the session slightly so the picker is dismissed when the session loading happens. I'll get a PR up shortly. If you want to test it, you can temporary change the top of your -- 'rmagatti/auto-session',
'cameronr/auto-session', After changing the config, you'll have to open Lazy (or whatever plugin manager you use) and update the plugin to actually pull it down (and restart nvim just to be sure). |
Yeah that fixed it! 🥳 Thank you so much for your patience and help. You also fixed the Oil dir conflict bug I had too! |
Describe the bug
If a session has a buffer with a terminal open restoring it will give an error saying that it's not possible to return to normal mode from the terminal. Possibly because it involves a different keybind/function. (<c-\>)
The session is restored correctly it's just that you the plugin gives an annoying error message.
To Reproduce
Open empty buffer
Open terminal buffer in a split
:vs |:terminal<cr>
Save session
:SessionSave
Close nvim
Open nvim again
Restore said session.
Expected behavior
Session is restored without errors.
Checkhealth
Baseline (please complete the following information):
sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions
Linux eleum 6.6.59 #1-NixOS SMP PREEMPT_DYNAMIC Fri Nov 1 00:58:34 UTC 2024 x86_64 GNU/Linux
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1693350652
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "
/nix/store/939b2xyf52q9w9nkp6ll20y6nqbm5ydl-neovim-unwrapped-0.9.5/share/nvim
"
https://github.com/leg7/flake/blob/main/computers/modules/systems/river/config/nvim/init.lua
Additional context
The text was updated successfully, but these errors were encountered: