akinsho / akinsho/toggleterm.nvim

[Bug] First hidden terminal is re-opened using {count}ToggleTerm command

未关闭
#322 19 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug help wanted low priority
主要语言
Lua
星标
5.6k
派生
206
PR 合并指标
30 天内没有已合并 PR

描述

If the first terminal I open in toggleterm is a hidden one with Terminal:new (floating), then :1ToggleTerm opens the hidden terminal instead a new one. Is there a way to prevent this?

My config:

```
local status, toggleterm = pcall(require, 'toggleterm')
if (not status) then return end

toggleterm.setup({
open_mapping = '†', -- Alt-Gr + t
insert_mappings = true,
terminal_mappings = true,
persist_size = false,
})

local Terminal = require('toggleterm.terminal').Terminal
local lazygit = Terminal:new({ cmd = "source ~/.zshrc; lazygit", hidden = true, direction = 'float' })
vim.keymap.set({ "n", "t" }, "©", function() lazygit:toggle() end, { noremap = true, silent = true }) -- Alt-Gr + g
```

So basically I open lazygit with the mapping right after I open up vim and then put it in the background with the same command and then run `:1ToggleTerm` and it opens up again.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。