akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.39k stars 176 forks source link

[BUG] TermSelect doesn't show anything #578

Open pipoprods opened 5 months ago

pipoprods commented 5 months ago

Is there an existing issue for this?

Current Behavior

I'm using mutiple floating terminals and switch between them using TermSelect.

Sometimes (didn't find how this arises yet), TermSelect doesn't respond (no selector UI is displayed). My terminals are still here as I still can open them using <number> ToggleTerm.

Expected Behavior

The terminal selection UI should be displayed.

Steps To Reproduce

(instructions to reproduce the problem to come when things become clearer to me).

Here's my config (Lazy.nvim block):

    {
        "akinsho/toggleterm.nvim",
        config = function()
            require("toggleterm").setup({
                shade_terminals = false,
                direction = "float",
                float_opts = {
                    border = "curved",
                },
                winbar = {
                    enabled = true,
                    name_formatter = function(term) --  term: Terminal
                        return term.name
                    end,
                },
                open_mapping = [[<F12>]],
                on_open = function()
                    -- Disable troll-stopper highlight
                    vim.cmd([[highlight TrollStopper ctermbg = none guibg = none]])
                end,
                on_close = function()
                    -- Enable troll-stopper highlight
                    vim.cmd([[highlight TrollStopper ctermbg = red guibg = red]])
                end,
            })

            vim.api.nvim_create_user_command("TermNew", function()
                term = require("toggleterm.terminal").Terminal:new({})
                term:spawn()
                term:toggle()
            end, { bang = true })
        end,
        keys = {
            { "<F12>", "<cmd>TermNew<cr>", desc = "NeoTree" },
            { "<S-F12>", "<cmd>ToggleTermSetName<cr>", mode = { "n", "t" }, desc = "NeoTree" },
            { "<F24>", "<cmd>ToggleTermSetName<cr>", mode = { "n", "t" }, desc = "NeoTree" },
            { "<C-F12>", "<cmd>TermNew<cr>", mode = { "n", "t" }, desc = "NeoTree" },
            { "<F36>", "<cmd>TermNew<cr>", mode = { "n", "t" }, desc = "NeoTree" },
            { "<M-F12>", "<cmd>TermSelect<cr>", mode = { "n", "t" }, desc = "NeoTree" },
            { "<F60>", "<cmd>TermSelect<cr>", mode = { "n", "t" }, desc = "NeoTree" },
        },
        cmd = { "TermNew" },
    },

Environment

- OS: Debian 12
- neovim version: v0.9.5
- Shell: zsh

Anything else?

No response

pipoprods commented 5 months ago

This issue is missing reproduction context. I'd like to trace things first. How could I investigate or log interesting things?