gitui
gitui copied to clipboard
Loading theme, seems broken
Describe the bug
Gitui cant read theme.ron file on macos
To Reproduce Steps to reproduce the behavior: 1 Place the following on your theme.ron
(
selected_tab: Some(Reset),
command_fg: Some(Rgb(205, 214, 244)),
selection_bg: Some(Rgb(88, 91, 112)),
selection_fg: Some(Rgb(205, 214, 244)),
cmdbar_bg: Some(Rgb(24, 24, 37)),
cmdbar_extra_lines_bg: Some(Rgb(24, 24, 37)),
disabled_fg: Some(Rgb(127, 132, 156)),
diff_line_add: Some(Rgb(166, 227, 161)),
diff_line_delete: Some(Rgb(243, 139, 168)),
diff_file_added: Some(Rgb(249, 226, 175)),
diff_file_removed: Some(Rgb(235, 160, 172)),
diff_file_moved: Some(Rgb(203, 166, 247)),
diff_file_modified: Some(Rgb(250, 179, 135)),
commit_hash: Some(Rgb(180, 190, 254)),
commit_time: Some(Rgb(186, 194, 222)),
commit_author: Some(Rgb(116, 199, 236)),
danger_fg: Some(Rgb(243, 139, 168)),
push_gauge_bg: Some(Rgb(137, 180, 250)),
push_gauge_fg: Some(Rgb(30, 30, 46)),
tag_fg: Some(Rgb(245, 224, 220)),
branch_fg: Some(Rgb(148, 226, 213))
)
Expected behavior The theme looks like the catpuccin mocha
Context (please complete the following information):
macos 14.4.1gitui nightly 2024-05-18rustc 1.78.0 (9b00956e5 2024-04-29)
Additional context
The log file says the following
.config/gitui/theme.ron"]: 2:24: Expected string
Thats the version brew installs, but even when moving to stable and installing with cargo install, it will give the same error
Going back to gitui 0.26.1 fixes the issue
Also it seems that inside nvim it simply ignores the theme.ron file and uses whatever nvim theme is currently applied, Idk if this is a misconfig on my side tho, but as far as I understand, calling gitui inside nvim or directly in terminal shouldnt change the theme (no alias or nothing with -t option configured)
I had the same problem so I went back to lazygit :)
some upstream crate changed the way Colors are serialized. thanks for reporting
No problem! And thanks a lot for such great utility tool
Unfortunately the Rgb notation for colors seems to have vanished from ratatui parsing colors, the way to achieve the same result now requires specifying colors in hex format #00ff00, sorry for the inconvenience. The upcoming PR #2243 will clarify this and 0.26.3 will mark this as a breaking change with a few examples
Can you figure out how to set indexed colors now?
yes, like this
(
selected_tab: Some("Reset"),
command_fg: Some("#4c4f69"),
selection_bg: Some("#acb0be"),
selection_fg: Some("#4c4f69"),
cmdbar_bg: Some("#e6e9ef"),
cmdbar_extra_lines_bg: Some("#e6e9ef"),
disabled_fg: Some("#4c4f69"),
diff_line_add: Some("#40a02b"),
diff_line_delete: Some("#d20f39"),
diff_file_added: Some("#df8e1d"),
diff_file_removed: Some("#e64553"),
diff_file_moved: Some("#8839ef"),
diff_file_modified: Some("#fe640b"),
commit_hash: Some("#7287fd"),
commit_time: Some("#5c5f77"),
commit_author: Some("#209fb5"),
danger_fg: Some("#d20f39"),
push_gauge_bg: Some("#1e66f5"),
push_gauge_fg: Some("#eff1f5"),
tag_fg: Some("#dc8a78"),
branch_fg: Some("#179399")
)
No, i mean indexed, which can be referenced by numbers from ANSI color table. It used to be like that: Indexed(18) (https://docs.rs/tui/0.12.0/tui/style/enum.Color.html)
AH, no, sorry, try just putting "" around it, if it doesn't work, just use google to convert to rgb HEX, that's what worked for me
AH, no, sorry, try just putting "" around it, if it doesn't work, just use google to convert to rgb HEX, that's what worked for me
Surrounding with quotes works. Thank you. It was silly not to try