diff options
-rw-r--r-- | Cargo.lock | 28 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 11 |
3 files changed, 40 insertions, 1 deletions
@@ -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]] |
746 | name = "numtoa" | ||
747 | version = "0.1.0" | ||
748 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
749 | checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" | ||
750 | |||
751 | [[package]] | ||
745 | name = "owning_ref" | 752 | name = "owning_ref" |
746 | version = "0.4.1" | 753 | version = "0.4.1" |
747 | source = "registry+https://github.com/rust-lang/crates.io-index" | 754 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -805,6 +812,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
805 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" | 812 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" |
806 | 813 | ||
807 | [[package]] | 814 | [[package]] |
815 | name = "redox_termios" | ||
816 | version = "0.1.1" | ||
817 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
818 | checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" | ||
819 | dependencies = [ | ||
820 | "redox_syscall", | ||
821 | ] | ||
822 | |||
823 | [[package]] | ||
808 | name = "redox_users" | 824 | name = "redox_users" |
809 | version = "0.3.4" | 825 | version = "0.3.4" |
810 | source = "registry+https://github.com/rust-lang/crates.io-index" | 826 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -954,6 +970,18 @@ dependencies = [ | |||
954 | ] | 970 | ] |
955 | 971 | ||
956 | [[package]] | 972 | [[package]] |
973 | name = "termion" | ||
974 | version = "1.5.5" | ||
975 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
976 | checksum = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" | ||
977 | dependencies = [ | ||
978 | "libc", | ||
979 | "numtoa", | ||
980 | "redox_syscall", | ||
981 | "redox_termios", | ||
982 | ] | ||
983 | |||
984 | [[package]] | ||
957 | name = "textwrap" | 985 | name = "textwrap" |
958 | version = "0.11.0" | 986 | version = "0.11.0" |
959 | source = "registry+https://github.com/rust-lang/crates.io-index" | 987 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -23,7 +23,7 @@ notify = "4.0" | |||
23 | [dependencies.cursive] | 23 | [dependencies.cursive] |
24 | version = "0.15" | 24 | version = "0.15" |
25 | default-features = false | 25 | default-features = false |
26 | features = ["crossterm-backend"] | 26 | features = ["termion-backend", "crossterm-backend"] |
27 | 27 | ||
28 | [dependencies.chrono] | 28 | [dependencies.chrono] |
29 | version = "0.4" | 29 | version = "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}; | |||
12 | use crate::utils::{load_configuration_file, AppConfig}; | 12 | use crate::utils::{load_configuration_file, AppConfig}; |
13 | 13 | ||
14 | use clap::{App as ClapApp, Arg}; | 14 | use clap::{App as ClapApp, Arg}; |
15 | |||
16 | #[cfg(target_os = "linux")] | ||
17 | use cursive::termion; | ||
18 | |||
19 | #[cfg(target_os = "windows")] | ||
15 | use cursive::crossterm; | 20 | use cursive::crossterm; |
21 | |||
16 | use cursive::views::{LinearLayout, NamedView}; | 22 | use cursive::views::{LinearLayout, NamedView}; |
17 | use lazy_static::lazy_static; | 23 | use 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", |