#1143462 alacritty: does not take padding into account when setting window width and height

Package:
alacritty
Source:
alacritty
Description:
Fast, cross-platform, OpenGL terminal emulator
Submitter:
Francesco Poli (wintermute)
Date:
2026-08-02 08:59:02 UTC
Severity:
normal
#1143462#5
Date:
2026-08-02 08:57:26 UTC
From:
To:
Hello,
thanks for maintaining this package in Debian!

I noticed that, with `resize_increments = true`, it fails to correctly
take padding into account, when resizing a window.

Let me try and explain.

I like to resize windows in discrete steps equal to cell dimensions,
hence I set `resize_increments = true` in the `[window]` configuration
section:

```
$ grep -A 5 window ~/.config/alacritty/alacritty.toml
[window]
dimensions = { columns = 80, lines = 24 }
padding = { x = 2, y = 2 }
opacity = 1.0
dynamic_title = true
resize_increments = true
```

But, as you see, I have also set a 2-pixel padding for both horizontal
and vertical directions.
The initial window dimensions are 80 columns and 24 lines (classical
terminal size!).

When I start alacritty, the initial window dimensions are correct:

```
$ alacritty -vv
[...]
[0.179311999s] [INFO ] [alacritty] Cell size: 9 x 18
[0.179344952s] [INFO ] [alacritty] Padding: 2 x 2
[0.179355479s] [INFO ] [alacritty] Width: 724, Height: 436
[0.186780168s] [INFO ] [alacritty] PTY dimensions: 24 x 80
[0.190239419s] [INFO ] [alacritty] Initialisation complete
```

Indeed, the width is 80 columns * 9 pixels/column + 2 * 2 pixels = 724
pixels, and height is 24 lines * 18 pixels/line + 2 * 2 pixels = 436
pixels. It correctly takes padding into account.
Please note that my window manager (Fluxbox) agrees that the window
dimensions are 80 columns and 24 lines.

But, when I resize the window to, say, 80 columns and 30 lines (via
Fluxbox), the result is:

```
[...]
[124.061869805s] [DEBUG] [alacritty_terminal] New num_cols is 79 and num_lines is 29
[124.068720759s] [INFO ] [alacritty] Padding: 2 x 2
[124.068785574s] [INFO ] [alacritty] Width: 720, Height: 540
```

The new width is 80 columns * 9 pixels/column = 720 pixels and the new
height is 30 lines * 18 pixels/line = 540 pixels, which fail to take
padding into account.
And indeed, after taking padding into account (which seems to happen too
late!), alacritty realizes it can only accommodate 79 columns and 29
lines.
This can be confirmed by looking at the actual window dimensions on
screen and at the actual numbers of columns and lines that fit in
the terminal emulator.

Please note that xterm, resized to 80 columns and 30 lines takes
a 2-pixel padding into account and has window dimensions 724 pixels
and 544 pixels...


Please fix this bug and/or forward my bug report upstream, as
appropriate.

Thanks for your time and dedication!