fix: xterm-256 foreground color

This commit is contained in:
hstyi
2025-01-02 17:52:35 +08:00
committed by hstyi
parent 38496b9f1b
commit 3ff6d93279

View File

@@ -831,9 +831,7 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea
37 -> foreground = mode - 30 + 1 37 -> foreground = mode - 30 + 1
// xterm-256 foreground color // xterm-256 foreground color
38 38 -> {
-> {
if (iterator.hasNext()) { if (iterator.hasNext()) {
when (val code = iterator.next()) { when (val code = iterator.next()) {
// rgb // rgb
@@ -841,7 +839,7 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea
val r = iterator.next() val r = iterator.next()
val g = iterator.next() val g = iterator.next()
val b = iterator.next() val b = iterator.next()
background = 65536 * r + 256 * g + b foreground = 65536 * r + 256 * g + b
} }
// index color // index color