Floats are overlay panes that appear on top of your splits. They are toggled with a keybinding and can be configured with rich behavior around persistence, scope, and lifecycle.
Floats are defined under floats in your session layout:
hx.ses.layout.define({
name = "default",
floats = {
{
key = "g",
command = "lazygit",
title = "git",
attributes = { per_cwd = true, sticky = true, global = true },
width_percent = 90,
height_percent = 90,
},
{
key = "f",
command = "fzf",
attributes = { per_cwd = true, sticky = true, global = true },
},
{
key = "t",
attributes = { global = false, destroy = true },
width_percent = 40,
height_percent = 30,
pos_x = 100,
pos_y = 0,
},
},
})And toggled via keybindings:
{ on = "press", mods = { hx.mod.alt }, key = "g",
when = "focus:any",
action = { type = hx.action.float_toggle, float = "g" } },| Field | Default | Description |
|---|---|---|
width_percent |
60 | Width as % of terminal (10–100) |
height_percent |
60 | Height as % of terminal (10–100) |
pos_x |
50 | Horizontal anchor (0=left, 50=center, 100=right) |
pos_y |
50 | Vertical anchor (0=top, 50=center, 100=bottom) |
padding_x |
1 | Left/right inner padding |
padding_y |
0 | Top/bottom inner padding |
Attributes control behavior. They are set under attributes = { ... }:
One float instance per working directory.
- Toggle
Alt+gin/repo/a→ opens the/repo/alazygit - Toggle
Alt+gin/repo/b→ opens the/repo/blazygit (separate instance) - Go back to
/repo/a→ shows the/repo/ainstance again
Useful for project-scoped tools: lazygit, nvim, REPLs, file browsers.
The float survives mux restarts.
- Pod is kept alive in a half-attached state when mux detaches or exits
- New mux automatically reclaims it on reattach
- Combine with
per_cwdfor directory-specific persistent floats
Controls tab scope.
global = true(recommended withper_cwd): Float is visible across all tabs. Visibility is tracked per-tab via a bitmask.global = false(default): Float is bound to the tab it was created on. Closing that tab destroys it.
When shown, this float hides all other floats on the current tab.
Useful for modal-style overlays where you want a single focused tool.
The float process is killed when the float is hidden.
- Meaningful only for tab-bound, non-
per_cwdfloats - Useful for fire-and-forget tools or one-shot dialogs
The float runs inside a sandboxed pod (Linux namespaces + cgroups).
See isolation for profiles and resource limits.
Each float can have custom border characters and colors:
style = {
top_left = "╭",
top_right = "╮",
bottom_left = "╰",
bottom_right = "╯",
horizontal = "─",
vertical = "│",
},
color = {
active = 2, -- palette index when focused
passive = 8, -- palette index when unfocused
},Embed a title or status module in the border:
style = {
position = "topcenter", -- topleft | topcenter | topright | bottomleft | bottomcenter | bottomright
module = "time", -- any built-in segment name
outputs = {
{ style = "bg:0 fg:1", format = "[" },
{ style = "bg:237 fg:250", format = " $output " },
{ style = "bg:0 fg:1", format = "]" },
},
},Set defaults for all floats in your mux config. Per-float values override these:
hx.mux.float.set_defaults({
width_percent = 65,
height_percent = 65,
color = { active = 2, passive = 237 },
attributes = { global = true },
})Spawn a one-off float from the command line:
hexe mux float --command "btop" --title "monitor" --size "80,70,0,0"
hexe mux float --command "zsh" --isolation sandbox
hexe mux float --command "bash /tmp/script.sh" --result-file /tmp/resultOptions:
| Flag | Description |
|---|---|
--command |
Command to run |
--title |
Border title |
--cwd |
Working directory |
--size WxH,X,Y |
Size and position |
--focus |
Focus the float on open |
--isolation <profile> |
Isolation profile |
--key <key> |
Exit key (sent on dismiss) |
--result-file <path> |
Write float output here on close |
--pass-env |
Pass current env to float |
--extra-env K=V |
Add extra env vars |
You can nudge a float's position with a keybinding:
{ on = "press", mods = { hx.mod.alt, hx.mod.shift }, key = "up",
action = { type = hx.action.float_nudge, dir = "up" } },See float_attributes.md for detailed notes on each attribute and edge cases.