AMythicDev / minus

An asynchronous, runtime data feedable terminal paging library for Rust

Home Page:https://crates.io/crates/minus/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flashing when mouse moving

EiEddie opened this issue · comments

Describe the bug
when I move my mouse on the terminal, pager is flashing.

To Reproduce
code as follows:

use std::fmt::Write;
use minus::{self, Pager};

fn main() -> Result<(), minus::MinusError> {
	let mut out = Pager::new();

	write!(out, "{}\n", "hello world ".repeat(1000))?;

	minus::page_all(out)?;

	Ok(())
}

and config on Cargo.toml is:

minus = { version = "5.5.1", default-features = false, features = [
	"static_output",
] }

run cargo run and move the mouse on terminal.

Expected behavior
it should not be flashing

Screenshots
minus

Desktop:

  • WSL, Ubuntu 22.04.2 LTS
  • Windows Terminal
  • zsh

Something else
I feel like I'm going blind...

Can you reproduce it on the latest main because I can't reproduce it on it.
EDIT: I also can't reproduce it on version 5.5.1. I am using Fedora 39 with Alacritty terminal.

YES!

first, I do:

cargo new test-minus
cd test-minus
cargo add minus --features static_output

and this is my test:

// src/main.rs
use std::fmt::Write;
use minus::{self, Pager};

fn main() -> Result<(), minus::MinusError> {
        let mut out = Pager::new();

        write!(out, "{}\n", "hello world ".repeat(1000))?;

        minus::page_all(out)?;

        Ok(())
}
# Cargo.toml

[package]
name = "test-minus"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
minus = { version = "5.5.1", features = ["static_output"] }

and result have the same wrong, the pager is flushing.

then, I do

git clone https://github.com/arijit79/minus.git
cd minus
cargo r --example static --features="static_output"

and unluckily, same wrong
minus

I guess you have to help me out a bit here cuz I don't have a Windows PC at hand. I am making a PR and you have to pull it and test it with some testing code. I hope it's not much of an inconvenience.

I'm glad to help✌️