ryanmsnyder / toggleterm-manager.nvim

A Telescope extension to manage Toggleterm's terminals in NeoVim
GNU General Public License v3.0
64 stars 4 forks source link

Keybindings do not work #4

Closed pmatulis closed 4 months ago

pmatulis commented 9 months ago

<CR> does not open a terminal. Instead, it selects the first terminal. <C-i> and <C-d> creates and deletes a terminal however. I just can't open any terminal.

I noticed that <C-d> will not delete all terminals in one Telescope session. I need to close the session and re-open it. The last remaining terminal is especially tenacious. It's weird.

ryanmsnyder commented 9 months ago

Hi @pmatulis, can you share your toggleterm-manager config with me?

pmatulis commented 9 months ago

I updated my initial comment as there were formatting problems and the description was not complete.

Configuration:

local toggleterm_manager = require("toggleterm-manager")
local actions = toggleterm_manager.actions

require("toggleterm-manager").setup {
  mappings = {
    i = {
      ["<CR>"]  = { action = actions.toggle_term, exit_on_action = false }, -- toggles terminal open/closed
      ["<C-i>"] = { action = actions.create_term, exit_on_action = false }, -- creates a new terminal buffer
      ["<C-d>"] = { action = actions.delete_term, exit_on_action = false }, -- deletes a terminal buffer
      ["<C-r>"] = { action = actions.rename_term, exit_on_action = false }, -- provides a prompt to rename a terminal
    },
  },
  titles = {
    preview = "Preview",
    prompt = " Terminals",
    results = "Results"
  },
}
ryanmsnyder commented 9 months ago

Thanks for providing the config. I just tested it on a clean install of NeoVim and it worked as expected for me. Also, just a note - your current config contains defaults of toggleterm-manager so you can actually get away with just calling:

local toggleterm_manager = require("toggleterm-manager")
toggleterm_manager.setup {}

Anyway, can you provide the current commit of toggleterm-manager that you have installed? Can you also provide your toggleterm config?

pmatulis commented 9 months ago

I do not know how to get the commit (would be nice to know) but I just updated with :PlugUpdate and the behaviour remains.

Its configuration is:

require("toggleterm").setup {
  open_mapping = [[<c-\>]],
  direction = 'float',
  float_opts = {
    border = 'curved',
    width = 125,
    height = 25,
  },
  highlights = {
    FloatBorder = {
      guifg = "#C39CC3",
      guibg = "#191616",
    },
  },
}
ryanmsnyder commented 7 months ago

Hi @pmatulis, I apologize for the late response. Please let me know if you're still having this issue.

meetmangukiya commented 3 months ago

<CR> doesnt work for me either, it works if you have exit_on_action=true