aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock28
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs11
3 files changed, 40 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 25e21e6..c4f9734 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -231,6 +231,7 @@ dependencies = [
231 "libc", 231 "libc",
232 "log", 232 "log",
233 "signal-hook", 233 "signal-hook",
234 "termion",
234 "unicode-segmentation", 235 "unicode-segmentation",
235 "unicode-width", 236 "unicode-width",
236] 237]
@@ -742,6 +743,12 @@ dependencies = [
742] 743]
743 744
744[[package]] 745[[package]]
746name = "numtoa"
747version = "0.1.0"
748source = "registry+https://github.com/rust-lang/crates.io-index"
749checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"
750
751[[package]]
745name = "owning_ref" 752name = "owning_ref"
746version = "0.4.1" 753version = "0.4.1"
747source = "registry+https://github.com/rust-lang/crates.io-index" 754source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -805,6 +812,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
805checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 812checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
806 813
807[[package]] 814[[package]]
815name = "redox_termios"
816version = "0.1.1"
817source = "registry+https://github.com/rust-lang/crates.io-index"
818checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
819dependencies = [
820 "redox_syscall",
821]
822
823[[package]]
808name = "redox_users" 824name = "redox_users"
809version = "0.3.4" 825version = "0.3.4"
810source = "registry+https://github.com/rust-lang/crates.io-index" 826source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -954,6 +970,18 @@ dependencies = [
954] 970]
955 971
956[[package]] 972[[package]]
973name = "termion"
974version = "1.5.5"
975source = "registry+https://github.com/rust-lang/crates.io-index"
976checksum = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905"
977dependencies = [
978 "libc",
979 "numtoa",
980 "redox_syscall",
981 "redox_termios",
982]
983
984[[package]]
957name = "textwrap" 985name = "textwrap"
958version = "0.11.0" 986version = "0.11.0"
959source = "registry+https://github.com/rust-lang/crates.io-index" 987source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index c587196..a0872ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ notify = "4.0"
23[dependencies.cursive] 23[dependencies.cursive]
24version = "0.15" 24version = "0.15"
25default-features = false 25default-features = false
26features = ["crossterm-backend"] 26features = ["termion-backend", "crossterm-backend"]
27 27
28[dependencies.chrono] 28[dependencies.chrono]
29version = "0.4" 29version = "0.4"
diff --git a/src/main.rs b/src/main.rs
index 3e35ebc..dec3156 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,7 +12,13 @@ use crate::command::{open_command_window, Command};
12use crate::utils::{load_configuration_file, AppConfig}; 12use crate::utils::{load_configuration_file, AppConfig};
13 13
14use clap::{App as ClapApp, Arg}; 14use clap::{App as ClapApp, Arg};
15
16#[cfg(target_os = "linux")]
17use cursive::termion;
18
19#[cfg(target_os = "windows")]
15use cursive::crossterm; 20use cursive::crossterm;
21
16use cursive::views::{LinearLayout, NamedView}; 22use cursive::views::{LinearLayout, NamedView};
17use lazy_static::lazy_static; 23use lazy_static::lazy_static;
18 24
@@ -62,7 +68,12 @@ fn main() {
62 println!("{}", h); 68 println!("{}", h);
63 } 69 }
64 } else { 70 } else {
71 #[cfg(target_os = "windows")]
65 let mut s = crossterm().unwrap(); 72 let mut s = crossterm().unwrap();
73
74 #[cfg(target_os = "linux")]
75 let mut s = termion().unwrap();
76
66 let app = App::load_state(); 77 let app = App::load_state();
67 let layout = NamedView::new( 78 let layout = NamedView::new(
68 "Frame", 79 "Frame",