Open srinathava opened 1 year ago
I found a workaround for this. Instead of
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
vim.cmd('terminal')
end)
return true
end,
if I instead defer executing the action using vim.schedule
, it seems to work as expected:
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
vim.schedule(function()
vim.cmd('terminal')
end)
end)
return true
end,
Description
I am trying to write a custom picker and some of the actions involve opening a terminal which is running some build process. I have noticed that executing those commands via the telescope picker always leaves me in "normal" mode, while executing the command from Neovim directly correctly goes into terminal mode as expected.
Neovim version
Operating system and version
debian 11
Telescope version / branch / rev
telescope 0.1.0
checkhealth telescope
Steps to reproduce
nvim -nu minimal.lua
with the attached minimal.luaOnce you see the message "Ready" echoed, issue the command
:lua colors()
Note that the command for picking any color is to just issue the Neovim
terminal
command.Expected behavior
We open a new terminal in
TERMINAL
modeActual behavior
The terminal opens, but in normal mode. You have to press
i
ora
to enterTERMINAL
mode.Minimal config