[GH-ISSUE #1050] Regression: Colors in autocomplete list are incorrect #761

Closed
opened 2026-03-04 01:07:33 +03:00 by kerem · 1 comment
Owner

Originally created by @gpanders on GitHub (Nov 3, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1050

Problem

Using SetAutocompleteStyles(tcell.ColorBlack, tcell.StyleDefault, tcell.StyleDefault.Reverse(true)) the background color of the autocomplete window should be ANSI color 0 (black) and the foreground color should use the terminal's default foreground color. Selected items should be reversed.

With my terminal color scheme, it looks like this before 03bdc867bee4ce7355079090c396d9ec861fc4bb:

Screenshot 2024-11-03 at 12 32 38 PM

After 03bdc867bee4ce7355079090c396d9ec861fc4bb, it looks like this:

Screenshot 2024-11-03 at 12 33 36 PM

Note that while the background of the window is still using color 0, the background color of the text is using the Default color (the terminal's background color rather than color 0).

Originally created by @gpanders on GitHub (Nov 3, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1050 **Problem** Using `SetAutocompleteStyles(tcell.ColorBlack, tcell.StyleDefault, tcell.StyleDefault.Reverse(true))` the background color of the autocomplete window should be ANSI color 0 (black) and the foreground color should use the terminal's default foreground color. Selected items should be reversed. With my terminal color scheme, it looks like this before [03bdc867bee4ce7355079090c396d9ec861fc4bb](https://github.com/rivo/tview/commit/03bdc867bee4ce7355079090c396d9ec861fc4bb): <img width="185" alt="Screenshot 2024-11-03 at 12 32 38 PM" src="https://github.com/user-attachments/assets/33336904-00f7-409e-ab64-c0987498ef91"> After [03bdc867bee4ce7355079090c396d9ec861fc4bb](https://github.com/rivo/tview/commit/03bdc867bee4ce7355079090c396d9ec861fc4bb), it looks like this: <img width="181" alt="Screenshot 2024-11-03 at 12 33 36 PM" src="https://github.com/user-attachments/assets/000f9fae-3115-4d85-8161-d1d020266329"> Note that while the background of the window is still using color 0, the background color of the text is using the `Default` color (the terminal's background color rather than color 0).
kerem closed this issue 2026-03-04 01:07:33 +03:00
Author
Owner

@gpanders commented on GitHub (Nov 3, 2024):

Perhaps not a regression, but just a bug fix. Updating my code to use SetAutocompleteStyles(tcell.ColorBlack, tcell.StyleDefault.Background(tcell.ColorBlack), tcell.StyleDefault.Reverse(true)) makes it work as expected.

<!-- gh-comment-id:2453531010 --> @gpanders commented on GitHub (Nov 3, 2024): Perhaps not a regression, but just a bug fix. Updating my code to use `SetAutocompleteStyles(tcell.ColorBlack, tcell.StyleDefault.Background(tcell.ColorBlack), tcell.StyleDefault.Reverse(true))` makes it work as expected.
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#761
No description provided.