[GH-ISSUE #1126] ANSIWriter: sequence \033[1;0m does not reset all attributes #814

Open
opened 2026-03-04 01:07:56 +03:00 by kerem · 0 comments
Owner

Originally created by @Ikke on GitHub (Oct 2, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1126

Demonstrated by the following go snippet:

buffer := bytes.Buffer{}
writer := tview.ANSIWriter(&buffer)
writer.Write([]byte("\033[1;0m"))
fmt.Println(buffer.String())
// output: [::b]

See https://go.dev/play/p/_yXZTydD9YL

The expectation is that it would reset all attributes due to the final 0;. So it should result in either [-:-:-] or at least [::b][-:-:-]. This is how it works in other terminals.

The effect is that something like \x033[1;32mtest\x033[1;0m causes all remaining text to be printed as green as well, while in terminals, and gitlab log output, all attributes are reset and the remaining text is printed normally.

Originally created by @Ikke on GitHub (Oct 2, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1126 Demonstrated by the following go snippet: ```go buffer := bytes.Buffer{} writer := tview.ANSIWriter(&buffer) writer.Write([]byte("\033[1;0m")) fmt.Println(buffer.String()) // output: [::b] ``` See https://go.dev/play/p/_yXZTydD9YL The expectation is that it would reset all attributes due to the final `0;`. So it should result in either `[-:-:-]` or at least `[::b][-:-:-]`. This is how it works in other terminals. The effect is that something like `\x033[1;32mtest\x033[1;0m` causes all remaining text to be printed as green as well, while in terminals, and gitlab log output, all attributes are reset and the remaining text is printed normally.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#814
No description provided.