summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorThomas Linford <tlinford@users.noreply.github.com>2021-05-16 18:00:22 +0200
committerGitHub <noreply@github.com>2021-05-16 17:00:22 +0100
commit28212f54309d09263c6daa1801d49e8b4311be12 (patch)
tree7465e20ae3a48fb3399cf8d8fd0a07b89f00a9ba /src/main.rs
parent8d742ccc53770032d8d5891a6ff43875f4987ede (diff)
handle error on termios initialization (#511)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 49e42ffbf..12842b58c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -39,10 +39,22 @@ pub fn main() {
atomic_create_dir(&*ZELLIJ_TMP_DIR).unwrap();
atomic_create_dir(&*ZELLIJ_TMP_LOG_DIR).unwrap();
if let Some(path) = opts.server {
- let os_input = get_server_os_input();
+ let os_input = match get_server_os_input() {
+ Ok(server_os_input) => server_os_input,
+ Err(e) => {
+ eprintln!("failed to open terminal:\n{}", e);
+ std::process::exit(1);
+ }
+ };
start_server(Box::new(os_input), path);
} else {
- let os_input = get_client_os_input();
+ let os_input = match get_client_os_input() {
+ Ok(os_input) => os_input,
+ Err(e) => {
+ eprintln!("failed to open terminal:\n{}", e);
+ std::process::exit(1);
+ }
+ };
start_client(Box::new(os_input), opts, config);
}
}