akinsho / akinsho/toggleterm.nvim

[Feature] add an option to prevent auto-closing float terminal on leaving the window

オープン
#420 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
difficulty: easy enhancement help wanted
主要言語
Lua
スター
5.6k
フォーク
206
PR マージ指標
30日以内にマージされた PR はありません

説明

Current implementation is auto close term when switch from a float terminal.
I found the implementation is in toggleterm.lua:
``` lua
local function handle_term_leave()
local _, term = terms.identify()
if not term then return end
if config.persist_mode then term:persist_mode() end
if term:is_float() then term:close() end
end
```
And there is no option or callback can be used to disable this behavior.

But sometimes auto-close float terminal is not the best choice.
For example, if I use a float terminal to compile or do some test job, if has error, I want to switch to code buffer to fix it without closing terminal since I need refer the output of terminal,
like below:

![image](https://user-images.githubusercontent.com/12163580/228867330-1193c53d-6655-4ed6-8e01-59f81f1eb329.png)

If I use terminal in the middle of the screen, auto close terminal for switching is reasonable.
But if I use float terminal on the top-right or bottom-right of the screen, auto-closing is not necessary, and in most user cases, it should be disabled.

Could you please considering to add an option flag to prevent this default behavior, so it can fit different strategy and requirement.

Thank you.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。