diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-07-11 20:03:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-11 20:03:09 +0300 |
commit | 18cf806a27f06185b1ceb2d63f3b9bc2dd3dc80e (patch) | |
tree | 6609ca3aec4fe8da171de474a4a8e8d9b572f0e5 /alacritty_terminal/src/panic.rs | |
parent | 5f039cee49b9c817177c6feecc5e7d97fb0a57e1 (diff) | |
download | r-alacritty-18cf806a27f06185b1ceb2d63f3b9bc2dd3dc80e.tar.gz r-alacritty-18cf806a27f06185b1ceb2d63f3b9bc2dd3dc80e.tar.bz2 r-alacritty-18cf806a27f06185b1ceb2d63f3b9bc2dd3dc80e.zip |
Remove gui dependencies from alacritty_terminal
This commit removes font dependency from alacritty_terminal,
so it'll simplify the usage of alacritty_terminal as a library,
since you won't link to system's libraries anymore. It also
moves many alacritty related config options from it.
Fixes #3393.
Diffstat (limited to 'alacritty_terminal/src/panic.rs')
-rw-r--r-- | alacritty_terminal/src/panic.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/alacritty_terminal/src/panic.rs b/alacritty_terminal/src/panic.rs deleted file mode 100644 index 4ec409ff..00000000 --- a/alacritty_terminal/src/panic.rs +++ /dev/null @@ -1,30 +0,0 @@ -#[cfg(windows)] -use crate::tty::windows::win32_string; - -// Use the default behavior of the other platforms. -#[cfg(not(windows))] -pub fn attach_handler() {} - -// Install a panic handler that renders the panic in a classical Windows error -// dialog box as well as writes the panic to STDERR. -#[cfg(windows)] -pub fn attach_handler() { - use std::{io, io::Write, panic, ptr}; - use winapi::um::winuser; - - panic::set_hook(Box::new(|panic_info| { - let _ = writeln!(io::stderr(), "{}", panic_info); - let msg = format!("{}\n\nPress Ctrl-C to Copy", panic_info); - unsafe { - winuser::MessageBoxW( - ptr::null_mut(), - win32_string(&msg).as_ptr(), - win32_string("Alacritty: Runtime Error").as_ptr(), - winuser::MB_ICONERROR - | winuser::MB_OK - | winuser::MB_SETFOREGROUND - | winuser::MB_TASKMODAL, - ); - } - })); -} |