From ba45b912562bb31b588d807cf2092a15a1c49f18 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Fri, 15 Oct 2021 08:57:32 +0100 Subject: [PATCH] cleanup --- core/src/terminal.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/core/src/terminal.rs b/core/src/terminal.rs index 7e0bfdc8..2a2b5a53 100644 --- a/core/src/terminal.rs +++ b/core/src/terminal.rs @@ -1,6 +1,6 @@ -use std::{collections::HashMap, ops::Index, path::PathBuf, sync::Arc}; +use std::{collections::HashMap, io::Read, ops::Index, path::PathBuf, sync::Arc}; -use alacritty_terminal::{Term, ansi::{self, CursorShape, Handler}, config::Program, event::{EventListener, Notify, OnResize}, event_loop::{EventLoop, Notifier}, sync::FairMutex, term::{cell::Cell, RenderableCursor, SizeInfo}, tty}; +use alacritty_terminal::{Term, ansi::{self, CursorShape, Handler}, config::Program, event::{EventListener, Notify, OnResize}, event_loop::{EventLoop, Notifier}, sync::FairMutex, term::{cell::Cell, RenderableCursor, SizeInfo}, tty::{self, EventedReadWrite}}; use anyhow::Result; use crossbeam_channel::{Receiver, Sender}; use druid::{ @@ -601,6 +601,21 @@ pub fn new(width: usize, height: usize, let size = SizeInfo::new(width as f32, height as f32, 1.0, 1.0, 0.0, 0.0, true); let pty = tty::new(&config, &size, None); + + // std::thread::spawn(move || { + // let mut config = TermConfig::default(); + // let size = + // SizeInfo::new(width as f32, height as f32, 1.0, 1.0, 0.0, 0.0, true); + // let mut pty = tty::new(&config, &size, None); + // let mut buf = [0u8;0x10_0000]; + // loop { + // + // match pty.reader().read(&mut buf) { + // Ok(n) => {println!("got {} bytes", n);} + // Err(e) => {println!("pty read error {}",e);} + // } + // } + // }); let terminal = Term::new(&config, size, event_proxy.clone()); let terminal = Arc::new(FairMutex::new(terminal)); let event_loop =