summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-01-17 00:42:26 +0100
committerKirill Chibisov <contact@kchibisov.com>2020-01-17 02:42:26 +0300
commit3203d2b3fa53cbab0cb3cda1ce53ba28c24482ee (patch)
tree2e4e72b09d56c0b5cbedcedb44778c3e4d2ff65f
parentf54aabfe9295902b6bbe0db115186ca26f1956b0 (diff)
downloadalacritty-3203d2b3fa53cbab0cb3cda1ce53ba28c24482ee.tar.gz
alacritty-3203d2b3fa53cbab0cb3cda1ce53ba28c24482ee.zip
Fix reset CLI parameters on config reload (#3216)
Fix reset CLI parameters on config reload Fixes #3197.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/config/mod.rs2
-rw-r--r--alacritty/src/event.rs4
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 209036c3..43c8f518 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Limited payload length in clipboard escape (used for Tmux copy/paste)
- Alacritty not ignoring keyboard events for changing WM focus on X11
- Regression which added a UNC path prefix to the working directory on Windows
+- CLI parameters discarded when config is reload
## 0.4.1
diff --git a/alacritty/src/config/mod.rs b/alacritty/src/config/mod.rs
index e489f5fb..19889887 100644
--- a/alacritty/src/config/mod.rs
+++ b/alacritty/src/config/mod.rs
@@ -150,7 +150,7 @@ fn read_config(path: &PathBuf) -> Result<Config> {
let mut contents = fs::read_to_string(path)?;
// Remove UTF-8 BOM
- if contents.chars().nth(0) == Some('\u{FEFF}') {
+ if contents.starts_with('\u{FEFF}') {
contents = contents.split_off(3);
}
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 7f5e385b..bfadbaec 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -35,6 +35,7 @@ use alacritty_terminal::term::{SizeInfo, Term};
use alacritty_terminal::tty;
use alacritty_terminal::util::{limit, start_daemon};
+use crate::cli::Options;
use crate::config;
use crate::config::Config;
use crate::display::Display;
@@ -482,6 +483,9 @@ impl<N: Notify + OnResize> Processor<N> {
processor.ctx.display_update_pending.message_buffer = Some(());
if let Ok(config) = config::reload_from(&path) {
+ let options = Options::new();
+ let config = options.into_config(config);
+
processor.ctx.terminal.update_config(&config);
if processor.ctx.config.font != config.font {