blacknon / hwatch

A modern alternative to the watch command, records the differences in execution results and can check this differences at after.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GNU screen 上で画面クリアがされない

cympfh opened this issue · comments

GNU screen 上で起動した場合に限り, hwatch 起動直後に画面クリアがされず, それまでのテキストが残ったままになります。
試しに明示的に terminal.clear()?; を追加してみると期待通りに動きました。
(このライブラリに明るくないのでこれが正しい修正なのかは知らないです)

--- a/src/view.rs
+++ b/src/view.rs
@@ -73,6 +73,7 @@ impl View {
         execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
         let backend = CrosstermBackend::new(stdout);
         let mut terminal = Terminal::new(backend)?;
+        terminal.clear()?;

         {
             let input_tx = tx.clone();

あ、ありがとうございます〜!
多分正しいです(どうやらscreenがデフォルトだとaltscreen対応してなくて、それが原因ぽいです)

fdehau/tui-rs#344

0.3.2で対応出来たのでクローズします