mirror-ghostty/src
Mitchell Hashimoto df0620afe9
Fix SGR direct-color parsing issue (#4216)
Fix for a little parsing issue I took note of
[here](https://github.com/ghostty-org/ghostty/issues/2125#issuecomment-2466537683).

The disparity in behavior between `ghostty@main` and `xterm` can be seen
with this reproduction script:
```sh
printf "\e[0m\nForeground:\n";
printf "\e[38:2:0:255:0mGreen\n";
printf "\e[38;2;0;255;0mGreen\n";
printf "\e[38:2:0:255:0:255mMagenta\n";
printf "\e[38;2;0;255;0;255mGreen\n";

printf "\e[0m\nBackground:\n";
printf "\e[48:2:0:255:0mGreen\n";
printf "\e[48;2;0;255;0mGreen\n";
printf "\e[48:2:0:255:0:255mMagenta\n";
printf "\e[48;2;0;255;0;255mGreen\n";

printf "\e[0m\nUnderline:\n";
printf "\e[58:2:0:255:0m\e[4mGreen\n";
printf "\e[58;2;0;255;0m\e[4mGreen\n";
printf "\e[58:2:0:255:0:255m\e[4mMagenta\n";
printf "\e[58;2;0;255;0;255m\e[4mGreen\n";

printf "\e[0m\n";
```

### Outputs:
|`xterm`|`ghostty@main`|this PR|
|-|-|-|
|<img width="85" alt="image"
src="https://github.com/user-attachments/assets/a0aacff2-2103-4fff-9160-5e663d8a70a2"
/>|<img width="110" alt="image"
src="https://github.com/user-attachments/assets/0ad12e67-3f2c-46f3-b0ee-9230032d188a"
/>|<img width="110" alt="image"
src="https://github.com/user-attachments/assets/7477e3cf-7d27-419e-986b-8df581e52398"
/>|
2024-12-31 12:13:05 -08:00
..
apprt gtk: also add css window-decorated class when toggling window decorations 2024-12-30 19:40:13 -06:00
bench remove old terminal implementation 2024-03-26 16:14:25 -07:00
build explicitly handle bool values 2024-12-31 09:36:23 +01:00
cli Fix typo in list-themes browser 2024-12-29 09:39:46 -08:00
config config: fix segfault if font-family is reset via the CLI 2024-12-30 21:30:48 -08:00
crash Allow startup without $HOME writable 2024-12-29 13:59:39 -08:00
datastruct terminal: sliding window search can move the cursor 2024-12-03 15:53:12 -08:00
font Enable bitmap font usage under CoreText (#4115) 2024-12-30 12:05:57 -08:00
input input: parse triggers with codepoints that map to keys as translated 2024-12-30 21:06:43 -08:00
inspector apprt/embedded: fix new size struct 2024-11-14 13:58:15 -08:00
os os: don't return stack memory 2024-12-30 12:21:28 -08:00
renderer renderer: track if fg/bg/cursor color is explicitly set by an OSC (#3228) 2024-12-29 09:05:37 -08:00
shell-integration bash: improved 'sudo' command wrapper (#4080) 2024-12-30 08:44:47 -08:00
simd config: yeet usingns 2024-08-16 10:49:37 -07:00
stb os: start yeeting 2024-08-16 10:57:19 -07:00
terminal fix(terminal): correct SGR direct color parsing 2024-12-31 15:05:25 -05:00
terminfo Fix some basic build errors. 2024-06-24 15:16:24 -07:00
termio renderer: track if fg/bg/cursor color is explicitly set by an OSC 2024-12-26 20:18:45 -06:00
unicode unicode: emoji modifier requires emoji modifier base preceding to not break 2024-12-12 12:53:08 -08:00
App.zig App applies conditional state, supports theme setting 2024-11-22 14:08:35 -08:00
Command.zig testing: point Command.zig at ~more universal external binaries 2024-12-27 17:07:24 +11:00
Surface.zig core: fix windows compile regression from #4021 2024-12-31 12:56:18 -06:00
apprt.zig libghostty: unified action dispatch 2024-09-26 22:00:11 -07:00
build_config.zig gtk: add option to not link against libX11 2024-12-28 13:40:17 -06:00
cli.zig c: remove the config load string API 2024-10-18 08:11:11 -07:00
config.zig confirm-close-surface option can be set to always to always require confirmation 2024-12-28 19:16:36 -08:00
fastmem.zig perf: introduce CacheTable strcture, use it for shaper cache 2024-06-10 13:58:35 -04:00
global.zig Allow startup without $HOME writable 2024-12-29 13:59:39 -08:00
helpgen.zig remove unused ziglyph import 2024-02-09 20:05:11 +01:00
input.zig macOS: "option-as-alt" defaults to "true" for US keyboard layouts 2024-12-11 10:27:08 -08:00
main.zig webgen: update config to support callouts, emit keybind actions 2024-12-19 17:15:39 -08:00
main_c.zig apprt/embedded: fix usingnamespace usage 2024-08-16 15:00:07 -07:00
main_ghostty.zig try to abstract bundle ID to a zig file 2024-11-25 16:11:02 -08:00
main_wasm.zig lots more yeeting 2024-08-16 14:35:10 -07:00
math.zig math style 2022-08-18 11:42:32 -07:00
pty.zig renderer: render lock for password input 2024-09-18 11:14:37 -07:00
quirks.zig font/shaper: split text runs on common bad ligature pairs 2024-08-11 15:26:36 -07:00
renderer.zig renderer: dedicated size struct, defined coordinate spaces 2024-11-14 12:36:21 -08:00
surface_mouse.zig macos: rectangle select only requires option + drag 2024-10-30 20:47:24 -04:00
termio.zig termio: yeet usingns 2024-08-16 10:36:10 -07:00