Skip to content

[BUG] Errors restoring session when a sidekick.nvim panel is saved to it #507

@jamesblckwell

Description

@jamesblckwell

Describe the bug
It seems like the plugin is running into issues restoring sidekick.nvim terminal buffers for whatever reason. I have attempted to close the buffer using both it's filetype (in close_filetype_on_save) and using the pre_save_cmds hook, both with no success - when the plugin is auto-saving. If I manually save the session using :AutoSession save then it closes the buffer just fine - however the session still errors on startup with the same error.

P.S I use ToggleTerm to handle regular terminal buffers and these seem to be working just fine leading me to believe this is an issue with sidekick.nvim/auto-session in particular.

To Reproduce
Steps to reproduce the behavior:

  1. Install folke/sidekick.nvim.
  2. Open the sidekick_terminal buffer.
  3. Save the session
  4. Restore the session

Expected behavior
I would expect the session to start without an error!

Screenshots
Error:

Image

AutoSession Config:

Image

Sidekick Config (ommitted keys for brevity):

Image

Checkhealth
Paste the contents of checkhealth auto-session here

auto-session:                                                               ✅

Setup ~
- ✅ OK setup() called

Lazy.nvim settings ~
- ✅ OK Lazy.nvim support is enabled
- ✅ OK auto-session is not lazy loaded

Config ~
- ✅ OK No config issues detected

Current Config ~
- {
    close_filetypes_on_save = { "sidekick_terminal" },
    pre_save_cmds = { <function 1> },
    suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }
  }

General Info ~
- Session directory: /home/james/.local/share/nvim/sessions/
- Current session: /home/james/.config/nvim
- Current session file: /home/james/.local/share/nvim/sessions/%2Fhome%2Fjames%2F%2Econfig%2Fnvim.vim
- Selected picker: telescope

Baseline (please complete the following information):

  • Result of set sessionoptions?: sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions
  • OS. e.g uname -a: Linux amatsu 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
  • Neovim version nvim --version: NVIM v0.11.5 Build type: RelWithDebInfo LuaJIT 2.1.1765228720 Run "nvim -V1 -v" for more info
  • Link to config: https://github.com/jamesblckwell/neovim-config/tree/bug/auto-session-sidekick-error

Additional context
The full session file I'm attempting to restore is available here: https://gist.github.com/jamesblckwell/020b3824a0e8488b39148d462004bdfa

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions