skywind3000 / asynctasks.vim

:rocket: Modern Task System for Project Building, Testing and Deploying !!
https://www.vim.org/scripts/script.php?script_id=5853
MIT License
915 stars 30 forks source link

The terminal ignores TermOpen autocmd #71

Open lluar opened 3 years ago

lluar commented 3 years ago

When I run a task then the terminal running in a new tab ignores my autocmd for TermOpen.

vim.cmd "autocmd TermOpen term://* startinsert"

The Terminal is always in normal mode.

MaiLunJiye commented 1 year ago

So do I.

Reproduce :

init.lua

vim.cmd("autocmd TermOpen * startinsert")

task.ini

[git-lazygit]
command=lazygit
cwd=$(VIM_CWD)
output=terminal
pos=tab
close=1

Result: use :terminal will open a terminal buffer and switch to insert mode. However, use AsyncTask open a terminal buffer, it will stay in normal mode.

skywind3000 commented 1 year ago

what about use asyncrun:

:AsyncRun -mode=term -pos=tab lazygit