a8m / a8m/pb

MultiBar does not honour custom handle on Windows

Offen
#88 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
600
Forks
59
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hello,

I am using a "/dev/null" like handle when my application is in quiet mode to hide the progress bar.

On unix, `tty::move_cursor_up` returns a string which is output to the handle.
On windows,` tty::move_cursor_up` print to the console and return an empty string whatever the handle is, making my trick to have a quiet mode totally failing.

I do not know if the windows code could be fixed easily. Otherwise what about introducing a quiet mode ?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Look at the Windows-specific code in the tty module, likely in src/tty.rs or a similar platform-specific file. The function `move_cursor_up` currently prints directly to the console instead of writing to the provided handle. Compare with the Unix implementation to see how it returns a string for output. Test by running the existing tests or creating a minimal example that uses a custom handle like `io::sink`. The fix should ensure the Windows version respects the handle and returns a string, not perform direct I/O.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.