When toggleterm is opened in a directory containing square brackets in the name ([ and ]) the following error appears:
E5108: Error executing lua vim/_editor.lua:0: nvim_exec2(): Vim:Error executing Lua callback: Vim:E944: Reverse range in character clas
s
stack traceback:
[C]: in function '_get_dir'
...re/nvim/lazy/toggleterm.nvim/lua/toggleterm/terminal.lua:395: in function '__spawn'
...re/nvim/lazy/toggleterm.nvim/lua/toggleterm/terminal.lua:469: in function 'spawn'
...re/nvim/lazy/toggleterm.nvim/lua/toggleterm/terminal.lua:486: in function 'open'
...re/nvim/lazy/toggleterm.nvim/lua/toggleterm/terminal.lua:508: in function 'toggle'
...local/share/nvim/lazy/toggleterm.nvim/lua/toggleterm.lua:79: in function 'toggle_nth_term'
...local/share/nvim/lazy/toggleterm.nvim/lua/toggleterm.lua:290: in function 'toggle'
...local/share/nvim/lazy/toggleterm.nvim/lua/toggleterm.lua:265: in function 'toggle_command'
...local/share/nvim/lazy/toggleterm.nvim/lua/toggleterm.lua:419: in function <...local/share/nvim/lazy/toggleterm.nvim/lua/togg
leterm.lua:419>
Expected Behavior
ToggleTerm should open regardless of whether the directory name contains square brackets or not.
Steps To Reproduce
Install toggleterm using lazy package manager
Using this config
require('toggleterm').setup({
direction = 'horizontal',
})
Open toggleterm in a directory that has both open and close square brackets eg: ~/[slug]
Is there an existing issue for this?
Current Behavior
When toggleterm is opened in a directory containing square brackets in the name (
[
and]
) the following error appears:Expected Behavior
ToggleTerm should open regardless of whether the directory name contains square brackets or not.
Steps To Reproduce
~/[slug]
Environment
Anything else?
I guess it is similar to this bug