-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] cursive with crossterm or termion backends redraws the screen every time #667
Comments
Hi - indeed, right now we re-draw the screen on any change or event. ncurses includes some internal caching to only re-draw the changes, which the other backends don't do at the moment. Eventually I plan on bringing this in cursive itself, but for now this wrapper may help your performance issue. |
Tried |
@gyscos Would a PR to integrate this into the Termion |
The buffered backend would benefit both the termion and crossterm backends, and really could be integrated around the |
This is reported to be occuring with the Cursive Termion backend as it redraws the screen every time, resulting in flickering for some users. Should be removed once Cursive has integrated this. See also: - gyscos/cursive#142 - gyscos/cursive#667 Fixes #934
Describe the bug
With default
ncurses
backend,cursive
applications feel smooth and does not blink in e.g. Alacritty.But with other backends (crossterm and termion), it seems like it just redraws the entire screen each time something is updated.
Also in scenario where
ncurses
backend write only 11 KB to the tty, but with the pure-Rust backends I see 174 KB of data. This may become problematic if TUI applications are accessed over SSH with bad network.To Reproduce
Example application
``` extern crate cursive_table_view;use std::cmp::Ordering;
use cursive::{
align::HAlign,
traits::{Nameable, Resizable},
views::{TextView, LinearLayout, TextArea},
Cursive, With,
};
use cursive_table_view::{TableView, TableViewItem};
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
enum MyColumn {
Name,
Count,
Rate,
}
#[derive(Clone, Debug)]
struct Foo {
name: String,
count: usize,
rate: usize,
}
impl TableViewItem for Foo {
fn to_column(&self, column: MyColumn) -> String {
match column {
MyColumn::Name => self.name.to_string(),
MyColumn::Count => format!("{}", self.count),
MyColumn::Rate => format!("{}", self.rate),
}
}
}
fn main() {
let mut siv = cursive::default();
}
The text was updated successfully, but these errors were encountered: