ncurses
This commit is contained in:
parent
dc9a5ddad2
commit
1e1fb9ecbd
24
Cargo.lock
generated
24
Cargo.lock
generated
@ -1217,7 +1217,10 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
|
"maplit",
|
||||||
|
"ncurses",
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
|
"term_size",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
@ -2637,6 +2640,17 @@ dependencies = [
|
|||||||
"socket2",
|
"socket2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ncurses"
|
||||||
|
version = "5.101.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5e2c5d34d72657dc4b638a1c25d40aae81e4f1c699062f72f467237920752032"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
"pkg-config",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ndk"
|
name = "ndk"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
@ -4329,6 +4343,16 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "term_size"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
|
@ -10,11 +10,16 @@ license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)"
|
|||||||
name = "veilid-cli"
|
name = "veilid-cli"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
cursive = { path = "../external/cursive/cursive", default-features = false, features = ["ncurses-backend", "toml"]}
|
||||||
|
|
||||||
|
[target.'cfg(not(unix))'.dependencies]
|
||||||
|
cursive = { path = "../external/cursive/cursive", default-features = false, features = ["crossterm-backend", "toml"]}
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "^1.9", features = ["unstable", "attributes"] }
|
async-std = { version = "^1.9", features = ["unstable", "attributes"] }
|
||||||
async-tungstenite = { version = "^0.8", features = ["async-std-runtime"] }
|
async-tungstenite = { version = "^0.8", features = ["async-std-runtime"] }
|
||||||
async_executors = { version = "^0", default-features = false, features = [ "async_std" ]}
|
async_executors = { version = "^0", default-features = false, features = [ "async_std" ]}
|
||||||
cursive = { path = "../external/cursive/cursive", default-features = false, features = ["crossterm-backend", "toml"]}
|
|
||||||
cursive-flexi-logger-view = { path = "../external/cursive-flexi-logger-view" }
|
cursive-flexi-logger-view = { path = "../external/cursive-flexi-logger-view" }
|
||||||
cursive_buffered_backend = { path = "../external/cursive_buffered_backend" }
|
cursive_buffered_backend = { path = "../external/cursive_buffered_backend" }
|
||||||
# cursive-multiplex = "0.4.0"
|
# cursive-multiplex = "0.4.0"
|
||||||
|
@ -649,9 +649,20 @@ impl UI {
|
|||||||
cursive_flexi_logger_view::resize(node_log_scrollback);
|
cursive_flexi_logger_view::resize(node_log_scrollback);
|
||||||
|
|
||||||
// Instantiate the cursive runnable
|
// Instantiate the cursive runnable
|
||||||
|
let runnable;
|
||||||
|
cfg_if::cfg_if! {
|
||||||
|
if #[cfg(unix)] {
|
||||||
|
runnable = CursiveRunnable::new(
|
||||||
|
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
||||||
|
let ncurses_backend = cursive::backends::curses::n::Backend::init().unwrap();
|
||||||
|
let buffered_backend =
|
||||||
|
cursive_buffered_backend::BufferedBackend::new(ncurses_backend);
|
||||||
|
|
||||||
// reduces flicker, but it costs cpu
|
Ok(Box::new(buffered_backend))
|
||||||
let runnable = CursiveRunnable::new(
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
runnable = CursiveRunnable::new(
|
||||||
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
||||||
let crossterm_backend = cursive::backends::crossterm::Backend::init().unwrap();
|
let crossterm_backend = cursive::backends::crossterm::Backend::init().unwrap();
|
||||||
let buffered_backend =
|
let buffered_backend =
|
||||||
@ -660,6 +671,8 @@ impl UI {
|
|||||||
Ok(Box::new(buffered_backend))
|
Ok(Box::new(buffered_backend))
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
//let runnable = cursive::default();
|
//let runnable = cursive::default();
|
||||||
|
|
||||||
// Make the callback mechanism easily reachable
|
// Make the callback mechanism easily reachable
|
||||||
|
Loading…
Reference in New Issue
Block a user