Skip to content

Commit 17ed668

Browse files
authored
fix(themes): Restore default theme, refactor (#2294)
* fix(theme): let the base colour remain unchanged * fix(theme): split out default * fix(theme): make base theme 'default' not an empty string * wip(theme): return styles, not colors * wip(theme): tidy up module structure a little * wip(theme): removed unhandled references to foreground_color * chore: fix cargo fmt * feat(theme): allow crossterm-deserializable colors
1 parent 95cef71 commit 17ed668

File tree

7 files changed

+246
-117
lines changed

7 files changed

+246
-117
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/atuin-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ indicatif = "0.17.7"
7171
tiny-bip39 = "1"
7272

7373
# theme
74-
crossterm = "0.27.0"
74+
crossterm = { version = "0.27.0", features = ["serde"] }
7575
palette = { version = "0.7.5", features = ["serializing"] }
7676
lazy_static = "1.4.0"
7777
strum_macros = "0.26.3"

crates/atuin-client/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ records = true
234234

235235
# [theme]
236236
## Color theme to use for rendering in the terminal.
237-
## There are some built-in themes, including the base theme which has the default colors,
237+
## There are some built-in themes, including the base theme ("default"),
238238
## "autumn" and "marine". You can add your own themes to the "./themes" subdirectory of your
239239
## Atuin config (or ATUIN_THEME_DIR, if provided) as TOML files whose keys should be one or
240240
## more of AlertInfo, AlertWarn, AlertError, Annotation, Base, Guidance, Important, and

crates/atuin-client/src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ pub struct Preview {
340340

341341
#[derive(Clone, Debug, Deserialize, Serialize)]
342342
pub struct Theme {
343-
/// Name of desired theme ("" for base)
343+
/// Name of desired theme ("default" for base)
344344
pub name: String,
345345

346346
/// Whether any available additional theme debug should be shown
@@ -756,7 +756,7 @@ impl Settings {
756756
.set_default("daemon.socket_path", socket_path.to_str())?
757757
.set_default("daemon.systemd_socket", false)?
758758
.set_default("daemon.tcp_port", 8889)?
759-
.set_default("theme.name", "")?
759+
.set_default("theme.name", "default")?
760760
.set_default("theme.debug", None::<bool>)?
761761
.set_default(
762762
"prefers_reduced_motion",

0 commit comments

Comments
 (0)