cpjreynolds / rustty

A terminal UI library
https://docs.rs/rustty
MIT License
153 stars 14 forks source link

[Linux] Empty terminal #51

Open Ilphrin opened 7 years ago

Ilphrin commented 7 years ago

Hi, I tried to use rustty for my application, I have implemented an equivalent to println for rustty, but when I launch it nothing happens, and when setting Cells it prints nothing:

extern crate rustty; use self::rustty::*;

pub struct Curses { pub streams: Vec, pub term: Terminal, }

trait TerminalUI { fn println_term(&mut self, startx: i32, starty: i32, value: &str); }

impl TerminalUI for Curses { fn println_term(&mut self, startx: i32, starty: i32, value: &str) { let mut x = startx as usize; let mut y = starty as usize; for c in value.chars() { self.term[(x, y)].set_bg(Color::Red); self.term[(x, y)].set_fg(Color::Blue); self.term[(x, y)] = Cell::with_char(c); x += 1; } } } ... self.println_term(3, 1, "What do you want to do?");

Am I missing something? Thanks!

cpjreynolds commented 6 years ago

Are you calling Terminal::swap_buffers()? Without that call no changes will be shown on screen.