akinsho / akinsho/toggleterm.nvim
[Feature] Allow multiple terminals opened in different tabpages
- Dominant language
- Lua
- Stars
- 5.6k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for making this awesome plugin, it makes nvim's builtin terminal much more ergonomic and user-friendly.
Sometimes I work on 2+ projects in neovim and keeps them in multiple tabs, and it would be nice to have multiple toggleterms opened in these tabs. Currently if I open a toggleterm in one tab, switch to another tab and call 'toggleterm.toggle_command()` again, toggleterm will close the terminal in the previous tabpage instead of opening a new one in the current tabpage.
I assume this might be a config issue and can be solved by passing proper opts to toggleterm? The following is my config if that's related:
```lua
local toggleterm = require('toggleterm')
toggleterm.setup({
open_mapping = '',
shade_terminals = false,
start_in_insert = false,
hide_numbers = true,
autochdir = false,
persist_size = false,
direction = 'horizontal',
float_opts = {
border = 'shadow',
width = function()
return math.floor(vim.go.columns * 0.7)
end,
height = function()
return math.floor(vim.go.lines * 0.7)
end,
winblend = 0,
},
size = function(term)
if term.direction == 'horizontal' then
return vim.go.lines * 0.3
elseif term.direction == 'vertical' then
return vim.go.columns * 0.35
end
end,
highlights = {
NormalFloat = { link = 'NormalFloat' },
FloatBorder = { link = 'FloatBorder' },
WinBarActive = { link = 'WinBar' },
WinBarInactive = { link = 'WinBarNC' },
MatchParen = { link = 'None' },
},
winbar = {
enabled = false,
},
on_open = function()
vim.cmd('silent! normal! 0')
end,
})
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.