Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvchad.term runner not working after closing terminal #445

Open
lo-quat opened this issue Mar 20, 2025 · 0 comments
Open

nvchad.term runner not working after closing terminal #445

lo-quat opened this issue Mar 20, 2025 · 0 comments

Comments

@lo-quat
Copy link

lo-quat commented Mar 20, 2025

I'm trying to set up a key mapping to run require("nvchad.term").runner, but I'm encountering an issue when trying to run it a second time after closing the terminal. It works fine on the first execution, but on the second attempt, it throws an error:

map("n", "<leader>rs", function()
  require("nvchad.term").runner {
    id = "id",
    pos = "vsp",
    size = 0.5,
    cmd = function()
      return "do something"
    end,
  }
end, { desc = "Do something" })
E5108: Error executing lua: ...okuma/.local/share/nvim/lazy/ui/lua/nvchad/term/init.lua:147: attempt to get length of field 'buf_history' (a nil value)
stack traceback:
        ...okuma/.local/share/nvim/lazy/ui/lua/nvchad/term/init.lua:147: in function 'runner'
        /Users/tokuma/.config/nvim/lua/mappings.lua:31: in function </Users/tokuma/.config/nvim/lua/mappings.lua:30>
Press ENTER or type command to continue

Is there a way to avoid this error or properly reset buf_history after closing the terminal? Any guidance would be appreciated!

@siduck siduck transferred this issue from NvChad/NvChad Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant