Jeff Quast efeb4aead0 Fix erroneous scroll when using X/Y offsets in images
Problem
-------

In update_dest_rect() when both num_cols and num_rows are 0
(auto-computed, ``a=T``), the first block computes num_cols with
cell_x_offset, but, then the second block mismatches num_cols, causing
it to compute width_px from num_cols and adds cell_x_offset a second
time. The returned value is large enough that it often causes scrolling,
depending on size and location of the screen.

A sample visual program:

```python
import zlib, base64, time
from functools import partial
echo = partial(print, end='', flush=True)

echo('\033[H\033[J')

base = bytes([0, 128, 0, 255]) * 640 * 576
k = zlib.compress(keyframe, 3)
echo(f'\033[8;60H\033_Ga=T,i=1,q=1,f=32,s=640,v=576,o=z,N=1;{base64.b64encode(k).decode()}\033\\')
time.sleep(1)

delta = bytes([200, 0, 0, 255]) * 32 * 512
d = zlib.compress(delta, 3)
echo(f'\033[9;67H\033_Ga=T,i=100,q=1,f=32,s=32,v=512,o=z,N=1,X=9,Y=25;{base64.b64encode(d).decode()}\033\\')

time.sleep(1)
print()
```

Solution
--------

Add 'auto_cols' and 'auto_rows' to remember the original read-only
values before exercising their auto-calculated size. 'auto_rows' isn't
technically necessary given the logic branching but it describes in code
better.

Before and After video
----------------------

A video will be attached shortly, here.
2026-07-12 18:22:40 -04:00
2026-07-12 09:58:05 +05:30
2026-07-12 12:16:01 +05:30
2026-07-09 07:01:18 +05:30
2026-07-06 11:18:16 +05:30
2026-07-09 07:46:27 +05:30
2026-07-06 11:18:16 +05:30

= kitty - the fast, feature-rich, cross-platform, GPU based terminal

If you live in the terminal, *kitty* is made for **you**!

See https://sw.kovidgoyal.net/kitty/[the kitty website].

image:https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg["Build status", link="https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI"]

https://sw.kovidgoyal.net/kitty/faq/[Frequently Asked Questions]

To ask other questions about kitty usage, use either the https://github.com/kovidgoyal/kitty/discussions/[discussions on GitHub] or the
https://www.reddit.com/r/KittyTerminal[Reddit community]

Packaging status in various repositories:

image:https://repology.org/badge/vertical-allrepos/kitty-terminal.svg?columns=3&header=kitty["Packaging status", link="https://repology.org/project/kitty-terminal/versions"]
Description
No description provided
Readme GPL-3.0 184 MiB
Languages
Python 38.6%
C 28%
Go 26.3%
Objective-C 5.5%
Shell 1%
Other 0.5%