Package: alacritty
Version: 0.16.1-4
Severity: normal
X-Debbugs-Cc: [email protected]

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!



-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 7.1.3+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages alacritty depends on:
ii  libc6               2.42-17
ii  libfontconfig1      2.17.1-5
ii  libfreetype6        2.14.3+dfsg-2
ii  libgcc-s1           16.1.0-3
ii  libwayland-client0  1.26.0-1
ii  libwayland-egl1     1.26.0-1
ii  libxkbcommon-x11-0  1.13.1-1
ii  ncurses-term        6.6+20260608-2

alacritty recommends no packages.

alacritty suggests no packages.

-- no debconf information

Reply via email to