bug fixe
This commit is contained in:
parent
33d587817e
commit
5b0a6dddaa
@ -15,7 +15,7 @@ readme = "README.md"
|
||||
winapi = { version = "0.3.5", features = ["winbase","winuser","consoleapi","processenv","wincon", "handleapi"] }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2.43"
|
||||
libc = "0.2.37"
|
||||
termios = "0.3.0"
|
||||
|
||||
[lib]
|
||||
|
@ -19,15 +19,15 @@ use std::io::Write;
|
||||
|
||||
fn main()
|
||||
{
|
||||
use crossterm::screen::RawScreen;
|
||||
use crossterm::Screen;
|
||||
|
||||
let mut screen = Screen::new(true);
|
||||
|
||||
write!(screen, "text \n\r");
|
||||
let a = screen.enable_alternate_modes(true).unwrap();
|
||||
|
||||
write!(a, "text \n\r");
|
||||
// use crossterm::screen::RawScreen;
|
||||
// use crossterm::Screen;
|
||||
//
|
||||
// let mut screen = Screen::new(true);
|
||||
//
|
||||
// write!(screen, "text \n\r");
|
||||
// let a = screen.enable_alternate_modes(true).unwrap();
|
||||
//
|
||||
// write!(a, "text \n\r");
|
||||
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ fn main() {
|
||||
let a = stdin.next();
|
||||
|
||||
match a {
|
||||
Some(Ok(b'\r')) =>
|
||||
Some(Ok(13)) =>
|
||||
{
|
||||
input_buf.lock().unwrap().clear();
|
||||
|
||||
@ -69,7 +69,7 @@ fn log(input_buf: Arc<Mutex<String>>) -> Vec<thread::JoinHandle<()>>
|
||||
|
||||
let join = thread::spawn( move || {
|
||||
|
||||
let crossterm = Crossterm::new(&Screen::default());
|
||||
let crossterm = Crossterm::new(&Screen::new(true));
|
||||
let cursor = crossterm.cursor();
|
||||
let terminal = crossterm.terminal();
|
||||
|
||||
|
@ -44,7 +44,7 @@ pub fn get_module<T>(winapi_impl: T, unix_impl: T) -> Option<T> {
|
||||
does_support = try_enable_ansi_support();
|
||||
|
||||
// uncomment this line when you want to use the winapi implementation.
|
||||
// does_support = true;
|
||||
does_support = true;
|
||||
if !does_support {
|
||||
term = Some(winapi_impl);
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ impl Screen
|
||||
if raw_mode
|
||||
{
|
||||
let screen = Screen { stdout: Arc::new(TerminalOutput::new()), buffer: Vec::new() };
|
||||
RawScreen::into_raw_mode();
|
||||
return screen;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user