Skip to content

Add a preference to zoom only the focused terminal - #2347

Open
dbolser wants to merge 1 commit into
Guake:masterfrom
dbolser:per-tab-zoom
Open

Add a preference to zoom only the focused terminal#2347
dbolser wants to merge 1 commit into
Guake:masterfrom
dbolser:per-tab-zoom

Conversation

@dbolser

@dbolser dbolser commented Aug 28, 2026

Copy link
Copy Markdown

What

Adds a preference, Appearance → "Zoom in/out affects only the focused terminal", so
each terminal can keep its own zoom level. It is off by default, so nothing changes
for existing users.

This addresses the first point of #1568 ("These font size changes apply to all the tabs,
not just the current one").

Terminal already had increase_font_size() / decrease_font_size() and a per-terminal
font_scale index for exactly this, but nothing called them — the accelerators went
straight to the configured font size instead. The preference wires them up.

Behaviour

zoom in/out affects
preference off (default) every terminal, by changing the configured font size, so it persists across restarts — as today
preference on the focused terminal only, as a scale on top of the configured font size

When zooming every terminal, the new size is now taken from the size the focused
terminal is showing, so terminals that had been zoomed individually snap to it instead of
keeping their offsets. Without that, switching the preference off left terminals
permanently different sizes.

Fixes noticed along the way

Both in the zoom-everything path:

  • The change was applied twice, once as a font size and once as a Vte font scale
    (set_font_scale(new_size / (new_size - 1))). A step was larger than intended, and
    zoom out did not undo zoom in — 10 → 13 → 10 came back as 10 → 13 → 11.
  • Zooming out repeatedly walked the font size down to 0. It now stops at 1.

Dropping the Vte font scale means the zoom-everything path no longer works by
multiplying the displayed font, so when use-default-font is set (the schema default)
— where fstyle_changed ignores the configured size and follows the desktop font — it
now zooms every terminal by the same font_scale level instead. Same visible result,
one mechanism.

Testing

Manually, in a nested X server, for both use-default-font values:

  • preference off: all terminals zoom together; the configured size round-trips exactly
    (10 → 13 → 10)
  • preference on: only the focused terminal changes; the configured size is untouched;
    splits and other tabs keep their own levels; new tabs open at the configured size
  • three tabs at three different levels, then preference off and one zoom in: all three
    snap to the focused tab's size
  • clamped at both ends without raising

black, flake8 and the glade/gschema parse are clean; the release note is in
releasenotes/notes/.

The zoom in/out shortcuts changed the configured font size and applied it
to every terminal, so terminals could not be sized individually. Add a
"Zoom in/out affects only the focused terminal" preference: when enabled,
each terminal keeps its own zoom level, as a scale on top of the
configured font size. It is off by default, keeping the current
behaviour. Addresses the first point of Guake#1568.

Terminal already had increase_font_size() and decrease_font_size() for
this, but nothing called them.

When zooming every terminal, start from the size the focused terminal
shows, so terminals that were zoomed individually snap to it rather than
keeping their offset, and drop their own zoom levels.

Zooming every terminal also applied the change twice, as a font size and
as a Vte font scale, making a step larger than intended and zoom out a
different size than zoom in; and it could reach a font size of zero.
Apply the font size alone, and stop at 1.

sem-ver: feature

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant