Skip to content

Commit a810159

Browse files
committed
use stdout for crossterm
1 parent 7947d80 commit a810159

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ use tenere::llm::LLMModel;
1414
use std::sync::Arc;
1515
use tokio::sync::Mutex;
1616

17-
use clap::{crate_version, Command};
17+
use clap::{crate_description, crate_version, Command};
1818

1919
#[tokio::main]
2020
async fn main() -> AppResult<()> {
2121
Command::new("tenere")
22+
.about(crate_description!())
2223
.version(crate_version!())
2324
.get_matches();
2425

@@ -33,7 +34,7 @@ async fn main() -> AppResult<()> {
3334
LLMModel::init(&config.llm, config.clone()).await,
3435
));
3536

36-
let backend = CrosstermBackend::new(io::stderr());
37+
let backend = CrosstermBackend::new(io::stdout());
3738
let terminal = Terminal::new(backend)?;
3839
let events = EventHandler::new(250);
3940
let mut tui = Tui::new(terminal, events);

src/tui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<B: Backend> Tui<B> {
2121

2222
pub fn init(&mut self) -> AppResult<()> {
2323
terminal::enable_raw_mode()?;
24-
crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?;
24+
crossterm::execute!(io::stdout(), EnterAlternateScreen, EnableMouseCapture)?;
2525

2626
let panic_hook = panic::take_hook();
2727
panic::set_hook(Box::new(move |panic| {
@@ -41,7 +41,7 @@ impl<B: Backend> Tui<B> {
4141

4242
fn reset() -> AppResult<()> {
4343
terminal::disable_raw_mode()?;
44-
crossterm::execute!(io::stderr(), LeaveAlternateScreen, DisableMouseCapture)?;
44+
crossterm::execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture)?;
4545
Ok(())
4646
}
4747

0 commit comments

Comments
 (0)