akinsho / akinsho/toggleterm.nvim

Question. Reuse terminal to execute new command

未关闭
#573 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Lua
星标
5.6k
派生
206
PR 合并指标
30 天内没有已合并 PR

描述

I am writing plugin, which can build project. Looks good to use toggleterm as environment to run build command. I don't want to allow user to execute any other commands but build, so i create terminal as
```lua
local cmake_build = Terminal:new({ cmd = "cmake --build ...", --[...]-- })
```
But, when building is done, user may want to build project again. I don't want to delete this terminal and open new one, since it requires for me to throw old terminal's size to new one and other boilerplate. Is it possible to kinda reinitialise terminal keeping same window, buffer and other it's parameters, except `cmd`, `env` and other i want to update. Or, maybe, it is possible to attach new terminal to old terminal's buffer, deleting the old one?

I still haven't fully decided how best to solve this problem, so I'd be glad to know about the method I'm missing. Thanks

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。