26 Commits

Author SHA1 Message Date
Qwerasd
7929e0bc09 fix: prevent flicker while shrinking screen by eliminating thread race
Before this fix, if vsync was on the GPU cells buffer could be cleared
for a frame while resizing the terminal down. This was due to the fact
that the surface sent messages for the resize to both the renderer and
the IO thread. If the renderer thread was processed first then the GPU
cells buffer(s) would be cleared and not rebuilt, because the terminal
state would be larger than the GPU cell buffers causing updateFrame to
bail out early, leaving empty cell buffers.

This fixes the problem by changing the origin of the renderer's resize
message to be the IO thread, only after properly updating the terminal
state, to avoid clearing the GPU cells buffers at a time they can't be
successfully rebuilt.
2024-08-14 19:46:24 -04:00
Jeffrey C. Ollie
ce5e55d4aa Implement the XTWINOPS (CSI t) control sequences that "make sense".
These sequences were implemented:

CSI 14 t - report the text area size in pixels
CSI 16 t - report the cell size in pixels
CSI 18 t - report the text area size in cells
CSI 21 t - report the window title

These sequences were not implemented because they manuipulate the window
state in ways that we do not want.

CSI 1 t
CSI 2 t
CSI 3 ; x ; y t
CSI 4 ; height ; width ; t
CSI 5 t
CSI 6 t
CSI 7 t
CSI 8 ; height ; width ; t
CSI 9 ; 0 t
CSI 9 ; 1 t
CSI 9 ; 2 t
CSI 9 ; 3 t
CSI 10 ; 0 t
CSI 10 ; 1 t
CSI 10 ; 2 t
CSI 24 t

These sequences were not implemented because they do not make sense in
a Wayland context:

CSI 11 t
CSI 13 t
CSI 14 ; 2 t

These sequences were not implemented because they provide information
about the screen that is unnecessary.

CSI 15 t
CSI 19 t

These sequences were not implemeted because Ghostty does not maintain an
icon title for windows.

CSI 20 t
CSI 22 ; 0 t
CSI 22 ; 1 t
CSI 23 ; 0 t
CSI 23 ; 1 t

These sequences were not implemented because of the additional
complexity of maintaining a stack of window titles.

CSI 22 ; 2 t
CSI 23 ; 2 t
2024-08-07 00:12:20 -05:00
Gregory Anders
b09e4e5d63 config: add cursor-invert-fg-bg option
When set, the cursor-invert-fg-bg option uses the inverted foreground
and background colors of the cursor's current cell to color the cursor,
rather than using a fixed color. This option has higher precedence than
the cursor-color and cursor-text options, but has lower precedence than
an OSC 12 command to change the cursor color.
2024-07-22 08:42:30 -05:00
Mitchell Hashimoto
137ba66211 terminal: implement in-band size reports (Mode 2048)
https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83
2024-07-17 10:18:15 -07:00
Mitchell Hashimoto
524f24aaf5 termio: remove unused data 2024-07-15 15:23:39 -07:00
Mitchell Hashimoto
8cd901450a remove unused derived config values 2024-07-15 10:53:01 -07:00
Mitchell Hashimoto
3867e20e72 termio: get rid of manual backend 2024-07-15 10:50:17 -07:00
Mitchell Hashimoto
835d622baa termio: writer => mailbox 2024-07-15 10:23:09 -07:00
Mitchell Hashimoto
001a6d2624 termio: reader => backend 2024-07-15 10:14:14 -07:00
Mitchell Hashimoto
3625e1e58e termio: take reader as option 2024-07-15 09:55:31 -07:00
Mitchell Hashimoto
4a4b9f2411 termio: trying to get Exec to not have access to full Opts 2024-07-15 09:45:58 -07:00
Mitchell Hashimoto
08ed60ceec termio: ReadData is gone! 2024-07-14 15:15:22 -07:00
Mitchell Hashimoto
89d407dd6a termio: excessive cursor reset 2024-07-14 15:13:41 -07:00
Mitchell Hashimoto
a848a53d26 termio: remove a ton of state 2024-07-14 15:10:05 -07:00
Mitchell Hashimoto
af7adedb50 termio: writer abstraction 2024-07-14 14:48:48 -07:00
Mitchell Hashimoto
f50c15c350 termio: ReadData doesn't need a loop 2024-07-14 09:40:53 -07:00
Mitchell Hashimoto
eec33f10e2 termio: remove more unused things 2024-07-13 19:27:17 -07:00
Mitchell Hashimoto
e30e635bed termio: move all subprocess logic to termio.Exec 2024-07-13 19:24:10 -07:00
Mitchell Hashimoto
7c23d61379 termio: rename 2024-07-13 18:50:37 -07:00
Mitchell Hashimoto
b3c2479f87 termio: move subprocess out to its own file 2024-07-13 15:20:38 -07:00
Mitchell Hashimoto
2e62e3354b termio: cleanup more state 2024-07-13 15:19:39 -07:00
Mitchell Hashimoto
bfbbe1485e termio: queueWrite no longer uses EventData 2024-07-13 15:19:38 -07:00
Mitchell Hashimoto
ffaf020576 termio: move stream handler to dedicated file, remove dep on EventData 2024-07-13 15:19:38 -07:00
Mitchell Hashimoto
e51180e4a9 termio: changeConfig on reader data 2024-07-13 15:19:38 -07:00
Mitchell Hashimoto
4e6e0f90c7 termio: remove data field 2024-07-13 15:19:38 -07:00
Mitchell Hashimoto
c4484938c5 termio: wip but it builds 2024-07-13 15:19:38 -07:00