20 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2acd7e8a42 kitty: respond OK with metadata on display transmissions 2024-09-03 11:05:16 -07:00
Mitchell Hashimoto
8e2d63b6fa small stylistic changes 2024-08-24 19:55:09 -07:00
Jeffrey C. Ollie
571988bf99 Clean up Kitty color protocol by using a union
Non-exhaustive enums should be avoided, use a union to
make the code cleaner and safer.
2024-08-21 11:57:27 -05:00
Mitchell Hashimoto
8df5ec10e3 Merge pull request #2113 from jcollie/osc-21
Implement Kitty Color Protocol (OSC 21)
2024-08-21 09:23:23 -04:00
Mitchell Hashimoto
6bf1acc5a2 terminal: move kitty color structs out to kitty package 2024-08-21 09:18:42 -04:00
Mitchell Hashimoto
9faca303dc termio: move renderer message sending out to separate func 2024-08-21 09:11:20 -04:00
Mitchell Hashimoto
e15db88656 termio: use new formatter, palette helper for kitty color protocol 2024-08-20 23:36:45 -04:00
Jeffrey C. Ollie
a2ef0ca751 Address review comments.
- Cap the total number of requests at twice the maximum number of
  keys (currently 263, so 526 requests). Basically you can set and then
  query every key in one message. This is an absurdly high number
  but should prevent serious DOS attacks.
- Clarify meaning of new hex color codes.
- Better handle sending messages to the renderer in a way that should
  prevent deadlocks.
- Handle 0-255 palette color requests by creatively using non-exhautive
  enums.
- Fix an error in the query reply.
2024-08-19 00:22:09 -05:00
Mitchell Hashimoto
18a8d2b01d Minor changes, mainly commenting to clarify some behaviors 2024-08-18 15:05:31 -07:00
Jeffrey C. Ollie
b11b8be124 Implement Kitty Color Protocol (OSC 21)
Kitty 0.36.0 added support for a new OSC escape sequence for
quering, setting, and resetting the terminal colors. Details
can be found [here](https://sw.kovidgoyal.net/kitty/color-stack/#setting-and-querying-colors).

This fully parses the OSC 21 escape sequences, but only supports
actually querying and changing the foreground color, the background
color, and the cursor color because that's what Ghostty currently
supports. Adding support for the other settings that Kitty supports
changing ranges from easy (cursor text) to difficult (visual bell,
second transparent background color).
2024-08-17 07:05:28 -05:00
Eduardo Dominguez
2e70ad20df Config: cursor-style can bet set to block_hollow
`cursor-style` can now also be set to `block_hollow`, no other changes
in behaviour are added.
2024-08-16 15:25:44 -06:00
Mitchell Hashimoto
ccf62a4960 stylistic nitpicks 2024-08-10 11:03:56 -07: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
835d622baa termio: writer => mailbox 2024-07-15 10:23:09 -07:00
Mitchell Hashimoto
af7adedb50 termio: writer abstraction 2024-07-14 14:48:48 -07:00
Mitchell Hashimoto
faef40b769 termio: fix up rebase 2024-07-13 15:21:50 -07:00
Mitchell Hashimoto
2e62e3354b termio: cleanup more state 2024-07-13 15:19:39 -07:00
Mitchell Hashimoto
ffaf020576 termio: move stream handler to dedicated file, remove dep on EventData 2024-07-13 15:19:38 -07:00