Replies: 3 comments 3 replies
-
|
tmux Scriptable now
#!/bin/bash
# tmux-style full-window zoom toggle. per-window state in a marker file.
set -u
wid=$(agtermctl window list --json | jq -r '.result.windows[]|select(.active)|.id')
marker="/tmp/agterm-zoom.${wid:-default}"
if [ -f "$marker" ]; then
read -r sid split < "$marker"
agtermctl sidebar show
[ "$split" = true ] && agtermctl session split on --target "$sid"
rm -f "$marker"
else
read -r sid split < <(agtermctl tree --json \
| jq -r '.result.tree.workspaces[].sessions[]|select(.active)|"\(.id) \(.split)"')
printf '%s %s\n' "$sid" "$split" > "$marker"
agtermctl sidebar hide
agtermctl session split off --target "$sid"
fione gotcha: keymap-launched commands run via What a script can't reach two gaps, both app-side:
so the everyday result is a keybinding away already, and building it in mainly buys the chrome-hide and an instant snap. If I do more, roughly three directions:
my default is do-nothing / minimal, but option 2 is worth having regardless, and a one-shot per-pane zoom (option 3) is genuinely appealing - probably comes down to how cheaply that per-pane zoom can be built. |
Beta Was this translation helpful? Give feedback.
-
Checkout #158 doesn't look terrible |
Beta Was this translation helpful? Give feedback.
-
|
update on the three directions from my earlier comment - a couple of the pieces I flagged are in now. option 2 (a command to resize an overlay after it's open) shipped as the two rough edges I called out on the scripted route are gone too:
so the scripted route is clean now. Current version, keyed off the live tree instead of a blind marker: #!/bin/bash
# tmux-style full-window zoom toggle, per-window marker state.
# zoom: hide the sidebar (only if showing) + collapse the split to the focused pane
# un-zoom: restore both to the pre-zoom state
set -u
wid=$(agtermctl window list --json | jq -r '.result.windows[]|select(.active)|.id')
marker="/tmp/agterm-zoom.${wid:-default}"
if [ -f "$marker" ]; then
read -r sid split sidebar < "$marker"
[ "$sidebar" != false ] && agtermctl sidebar show
[ "$split" = true ] && [ -n "$sid" ] && agtermctl session split on --target "$sid"
rm -f "$marker"
else
tree=$(agtermctl tree --json)
sidebar=$(printf %s "$tree" | jq -r '.result.tree.sidebarVisible')
read -r sid split < <(printf %s "$tree" \
| jq -r '.result.tree.workspaces[].sessions[]|select(.active)|"\(.id) \(.split)"')
printf '%s %s %s\n' "$sid" "$split" "$sidebar" > "$marker"
[ "$sidebar" != false ] && agtermctl sidebar hide
[ -n "$sid" ] && agtermctl session split off --target "$sid"
fi( none of this replaces option 3. An addressable, per-surface zoom over the control API is still a valuable addition on its own: drivable headless, and it reaches the quick terminal and overlays that a sidebar/split script can't. The building blocks above just make the scripted version solid in the meantime. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm missing this feature from my tmux setup: zoom to full window in any terminal surface. It works like a toggle, per window.
Demo
Screenshot.2026-07-06.at.16.20.18.mp4
p.s. probably should show window controls in zoomed-in state too, looks a bit alien without it. But not sure yet.
Beta Was this translation helpful? Give feedback.
All reactions