From 4ddb608563d985060d69594d1004550a680ae3bd Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 31 Aug 2022 22:48:38 +0000 Subject: Add IPC config subcommand This patch adds a new mechanism for changing configuration options without editing the configuration file, by sending options to running instances through `alacritty msg`. Each window will load Alacritty's configuration file by default and then accept IPC messages for config updates using the `alacritty msg config` subcommand. By default all windows will be updated, individual windows can be addressed using `alacritty msg config --window-id "$ALACRITTY_WINDOW_ID"`. Each option will replace the config's current value and cannot be reset until Alacritty is restarted or the option is overwritten with a new value. Configuration options are passed in the format `field.subfield=value`, where `value` is interpreted as yaml. Closes #472. --- alacritty_terminal/src/index.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal/src/index.rs') diff --git a/alacritty_terminal/src/index.rs b/alacritty_terminal/src/index.rs index e672c752..9464b8d8 100644 --- a/alacritty_terminal/src/index.rs +++ b/alacritty_terminal/src/index.rs @@ -7,6 +7,8 @@ use std::ops::{Add, AddAssign, Deref, Sub, SubAssign}; use serde::{Deserialize, Serialize}; +use alacritty_config_derive::SerdeReplace; + use crate::grid::Dimensions; /// The side of a cell. @@ -222,7 +224,19 @@ impl PartialEq for Line { /// A column. /// /// Newtype to avoid passing values incorrectly. -#[derive(Serialize, Deserialize, Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd)] +#[derive( + SerdeReplace, + Serialize, + Deserialize, + Debug, + Copy, + Clone, + Eq, + PartialEq, + Default, + Ord, + PartialOrd, +)] pub struct Column(pub usize); impl fmt::Display for Column { -- cgit