Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/toggleterm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ what options are available. It is not written to be used as is.
zindex = <value>,
title_pos = 'left' | 'center' | 'right', position of the title of the floating window
},
sticky_floats = false, -- if true then floating windows will not be hidden when they lose focus
winbar = {
enabled = false,
name_formatter = function(term) -- term: Terminal
Expand Down
4 changes: 3 additions & 1 deletion lua/toggleterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ 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
if config.sticky_floats == false then
if term:is_float() then term:close() end
end
end

local function on_term_open()
Expand Down
1 change: 1 addition & 0 deletions lua/toggleterm/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ local config = {
shell = vim.o.shell,
autochdir = false,
auto_scroll = true,
sticky_floats = false,
winbar = {
enabled = false,
name_formatter = function(term) return fmt("%d:%s", term.id, term:_display_name()) end,
Expand Down