You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libghostty parses OSC 4/10/11 sets but silently drops the query form
(`?` value) and does not expose a callback for them, so programs like
duf that auto-detect the theme via termenv get no reply.
Scan raw input in `fnWriteInput` for OSC 4/10/11 query payloads and
reply via the existing `ghostel--flush-output` path, using the
effective colors from libghostty. The extractor runs before `vtWrite`
so the color reply is on the wire before any response libghostty
generates (e.g. the CSI 6n cursor-position reply duf sends in the
same write) — termenv reads the first chunk off stdin, so ordering
matters.
A single-pass scanner walks ESC `]` introducers in source order so
replies to multiple different-type queries in one write come back in
the same order the client wrote them. Only fully-terminated OSC
sequences produce a reply — a query split across process-output
chunks is left for a later call. `parseDecimal` uses
`std.fmt.parseInt` so numeric overflow is rejected instead of wrapping
into the valid palette range.
The process filter previously batched all output for the redraw timer,
which delayed the reply past duf's read timeout. Detect color queries
in `ghostel--filter` and flush the pending buffer synchronously so the
reply is written back through the PTY before the filter returns.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,6 +219,7 @@ loaded scrollback.
219
219
### Terminal Emulation
220
220
- Full VT terminal emulation via libghostty-vt
221
221
- 256-color and RGB (24-bit true color) support
222
+
-**OSC 4 / 10 / 11 color queries** — TUI programs can query the current palette, foreground, and background colors, so tools like `duf`, `btop`, `delta`, and anything else using `termenv` auto-detect the right light/dark theme from the Emacs face colors
222
223
- Text attributes: bold, italic, faint, underline (single/double/curly/dotted/dashed with color), strikethrough, inverse
223
224
- Cursor styles: block, bar, underline, hollow block
0 commit comments