aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/config/general.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2024-09-22 00:10:48 +0200
committerChristian Duerr <contact@christianduerr.com>2024-10-02 21:38:07 +0200
commit51089cfeed1adfd741d8dcbe6c9cb9376f88a576 (patch)
treedaf97f64f3236b99b8593f62f2d2864882ac88b0 /alacritty/src/config/general.rs
parentc899208e15c8987480912794d66358ea2581fc39 (diff)
downloadr-alacritty-51089cfeed1adfd741d8dcbe6c9cb9376f88a576.tar.gz
r-alacritty-51089cfeed1adfd741d8dcbe6c9cb9376f88a576.tar.bz2
r-alacritty-51089cfeed1adfd741d8dcbe6c9cb9376f88a576.zip
Move root config fields to `[general]` section
Some users struggle with TOML, since root options must always be at the top of the file, since they're otherwise associated with the last table. To avoid misunderstandings, all root-level fields have been removed. A new `general` section was added to allow housing configuration options that do not fit into any more specific groups. Closes #7906.
Diffstat (limited to 'alacritty/src/config/general.rs')
-rw-r--r--alacritty/src/config/general.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/alacritty/src/config/general.rs b/alacritty/src/config/general.rs
new file mode 100644
index 00000000..ba559262
--- /dev/null
+++ b/alacritty/src/config/general.rs
@@ -0,0 +1,39 @@
+//! Miscellaneous configuration options.
+
+use std::path::PathBuf;
+
+use alacritty_config_derive::ConfigDeserialize;
+
+/// General config section.
+///
+/// This section is for fields which can not be easily categorized,
+/// to avoid common TOML issues with root-level fields.
+#[derive(ConfigDeserialize, Clone, PartialEq, Debug)]
+pub struct General {
+ /// Configuration file imports.
+ ///
+ /// This is never read since the field is directly accessed through the config's
+ /// [`toml::Value`], but still present to prevent unused field warnings.
+ pub import: Vec<String>,
+
+ /// Shell startup directory.
+ pub working_directory: Option<PathBuf>,
+
+ /// Live config reload.
+ pub live_config_reload: bool,
+
+ /// Offer IPC through a unix socket.
+ #[allow(unused)]
+ pub ipc_socket: bool,
+}
+
+impl Default for General {
+ fn default() -> Self {
+ Self {
+ live_config_reload: true,
+ ipc_socket: true,
+ working_directory: Default::default(),
+ import: Default::default(),
+ }
+ }
+}