akinsho / akinsho/toggleterm.nvim

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

Offen
#322 19 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug help wanted low priority
Vorherrschende Sprache
Lua
Sterne
5.6k
Forks
206
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.