aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src/main.rs')
-rw-r--r--alacritty/src/main.rs27
1 files changed, 18 insertions, 9 deletions
diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs
index 9fbcab55..ae3ef346 100644
--- a/alacritty/src/main.rs
+++ b/alacritty/src/main.rs
@@ -1,7 +1,6 @@
//! Alacritty - The GPU Enhanced Terminal.
#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)]
-#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
#![cfg_attr(all(test, feature = "bench"), feature(test))]
// With the default subsystem, 'console', windows creates an additional console
// window for the program.
@@ -24,10 +23,6 @@ use log::{error, info};
use winapi::um::wincon::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
use alacritty_terminal::event_loop::{self, EventLoop, Msg};
-#[cfg(target_os = "macos")]
-use alacritty_terminal::locale;
-use alacritty_terminal::message_bar::MessageBuffer;
-use alacritty_terminal::panic;
use alacritty_terminal::sync::FairMutex;
use alacritty_terminal::term::Term;
use alacritty_terminal::tty;
@@ -40,7 +35,13 @@ mod daemon;
mod display;
mod event;
mod input;
+#[cfg(target_os = "macos")]
+mod locale;
mod logging;
+mod message_bar;
+mod meter;
+#[cfg(windows)]
+mod panic;
mod renderer;
mod scheduler;
mod url;
@@ -59,8 +60,10 @@ use crate::config::monitor::Monitor;
use crate::config::Config;
use crate::display::Display;
use crate::event::{Event, EventProxy, Processor};
+use crate::message_bar::MessageBuffer;
fn main() {
+ #[cfg(windows)]
panic::attach_handler();
// When linked with the windows subsystem windows won't automatically attach
@@ -87,7 +90,7 @@ fn main() {
let config = options.into_config(config);
// Update the log level from config.
- log::set_max_level(config.debug.log_level);
+ log::set_max_level(config.ui_config.debug.log_level);
// Switch to home directory.
#[cfg(target_os = "macos")]
@@ -97,7 +100,7 @@ fn main() {
locale::set_locale_environment();
// Store if log file should be deleted before moving config.
- let persistent_logging = config.persistent_logging();
+ let persistent_logging = config.ui_config.debug.persistent_logging;
// Run Alacritty.
if let Err(err) = run(window_event_loop, config) {
@@ -161,7 +164,13 @@ fn run(window_event_loop: GlutinEventLoop<Event>, config: Config) -> Result<(),
// renderer and input processing. Note that access to the terminal state is
// synchronized since the I/O loop updates the state, and the display
// consumes it periodically.
- let event_loop = EventLoop::new(Arc::clone(&terminal), event_proxy.clone(), pty, &config);
+ let event_loop = EventLoop::new(
+ Arc::clone(&terminal),
+ event_proxy.clone(),
+ pty,
+ config.hold,
+ config.ui_config.debug.ref_test,
+ );
// The event loop channel allows write requests from the event processor
// to be sent to the pty loop and ultimately written to the pty.
@@ -171,7 +180,7 @@ fn run(window_event_loop: GlutinEventLoop<Event>, config: Config) -> Result<(),
//
// The monitor watches the config file for changes and reloads it. Pending
// config changes are processed in the main loop.
- if config.live_config_reload() {
+ if config.ui_config.live_config_reload() {
config.config_path.as_ref().map(|path| Monitor::new(path, event_proxy.clone()));
}