Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

toggleterm error

Open
#85 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
lua, neovim, vim
Domain
tooling

Research direction

Reproduce the issue by running a toggleterm task twice, then inspect lua/asyncrun/toggleterm.lua at lines 9, 14, and 23 and the Telescope entry point at lua/telescope/_extensions/asynctasks.lua:42. Done means the task runs again without errors both with the default behavior and with vim.g.asynctasks_term_reuse = 1.

Written by the indexing model from the issue text.

Description

If I use toggleterm as pos I can run the task only once. The second time I get the following error:

E5108: Error executing lua ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: Vim(lua):E5108: Error executing lua ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:9: Terminal existed
stack traceback:
        [C]: in function 'error'
        ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:9: in function 'reset'
        ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:23: in function 'runner'
        [string ":lua"]:1: in main chunk
        [C]: in function 'cmd'
        ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: in function 'key_func'
        ...ack/paqs/start/telescope.nvim/lua/telescope/mappings.lua:242: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: in function 'key_func'
        ...ack/paqs/start/telescope.nvim/lua/telescope/mappings.lua:242: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

If iI set vim.g.asynctasks_term_reuse = 1, I get this error

Delete existing terminal
E5108: Error executing lua ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: Vim(lua):E5108: Error executing lua ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:14: Expected lua string

stack traceback:
        [C]: in function 'nvim_del_keymap'
        ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:14: in function 'reset'
        ...pack/paqs/start/asyncrun.vim/lua/asyncrun/toggleterm.lua:23: in function 'runner'
        [string ":lua"]:1: in main chunk
        [C]: in function 'cmd'
        ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: in function 'key_func'
        ...ack/paqs/start/telescope.nvim/lua/telescope/mappings.lua:242: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...asynctasks.nvim/lua/telescope/_extensions/asynctasks.lua:42: in function 'key_func'
        ...ack/paqs/start/telescope.nvim/lua/telescope/mappings.lua:242: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
Dominant language
Vim Script
Stars
936
Forks
32
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skywind3000/asynctasks.vim

All issues in skywind3000/asynctasks.vim

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.