You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Vertical and Horizontal directions don't work when Snacks Explorer focused #660
I get an invalid direction when I have Snacks Explorer focused. Spent a bunch of time trouble shooting, and realized this was the only cause. It only happens at first launch when the picker is automatically focused. It seems like it's probably a ToggleTerm issue so I'm posting here.
This is the only error message I get:
...ckages/start/toggleterm.nvim/lua/toggleterm/terminal.lua:466: Invalid terminal direction
I was running into the same issue, and did some debugging.
Firstly, one important behavior to note is it's only an issue if the first time you try open a terminal is with explorer focused - if you've already opened/closed it in another window, opening will work fine from the explorer.
The issue starts here - the error we're seeing is the one at the end of the function:
functionM.is_float(window) returnfn.win_gettype(window) =="popup" end
With some logging, I found the very first time you open the terminal, self.window isn't set - which makes sense since it hasn't opened the window yet. This means it passes nil to win_gettype, which ends up returning the type of the current window. This seems like the root bug? Snacks explorer is a pop up, so if you open your first terminal with it (or any other popup) selected, self.window is nil so is_float will return true, causing is_split to return false, and opener to error.
Activity
apple1417 commentedon Feb 2, 2026
I was running into the same issue, and did some debugging.
Firstly, one important behavior to note is it's only an issue if the first time you try open a terminal is with explorer focused - if you've already opened/closed it in another window, opening will work fine from the explorer.
The issue starts here - the error we're seeing is the one at the end of the function:
toggleterm.nvim/lua/toggleterm/terminal.lua
Lines 454 to 468 in 9a88eae
We get the error when
term:is_split()returns false, on all successful attempts it returns true. Following it.toggleterm.nvim/lua/toggleterm/terminal.lua
Lines 238 to 241 in 9a88eae
toggleterm.nvim/lua/toggleterm/ui.lua
Lines 413 to 415 in 9a88eae
With some logging, I found the very first time you open the terminal,
self.windowisn't set - which makes sense since it hasn't opened the window yet. This means it passes nil to win_gettype, which ends up returning the type of the current window. This seems like the root bug? Snacks explorer is a pop up, so if you open your first terminal with it (or any other popup) selected,self.windowis nil sois_floatwill return true, causingis_splitto return false, andopenerto error.fix error if you have a popup window selected the first time you open…