a8m / a8m/pb

Allow for terminal colours to be applied to progress characters

Aperta
#38 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
600
Fork
59
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm trying to colour the progress format characters using the ansi_term crate. Consider the following format:

```[=>_]```

If the equals sign is to be red and bolded, at least on the Windows platform the format string becomes:

```[\u{1b}[1;31m=\u{1b}[0m>_]```

This sort of format string is not compatible with the current library.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Look at the progress bar formatting code, likely in a module handling format strings. The issue shows an example with ANSI escape sequences. You need to modify the parsing to allow escape codes within the format string without breaking the progress character counting. Check how the format string is currently parsed and rendered, and ensure the escape sequences are stripped for length calculations but passed through for output. Test on Windows to confirm the colored characters display correctly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
40/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.