felangel / felangel/mason

fix: (logger) when terminal is full chooseOne repeats lines

Offen
#507 0 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Dart
Sterne
1.1k
Forks
113
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Description**

If the terminal screen is full, in other words it is scrollable, then the `chooseOne` logger function does not redraw correctly when switching between options. It repeats certain lines of the prompt. Normally it repeats the message but sometime it repeats the message and the choices.

**Steps To Reproduce**

1. Fill the terminal with any commands, or resize the terminal so that you can scroll.
2. Run a dart file with the logger.chooseOne(). Below is what I am running:
```dart
Future main() async {
final logger = Logger(
level: Level.verbose,
);

final favoriteColor = logger.chooseOne(
"${styleBold.wrap(lightGreen.wrap('?'))} Select and environment",
choices: ['red', 'green'],
defaultValue: 'blue',
);
}

```

**Expected Behavior**

Changing options does not duplicate any lines.

**Screenshots**

Screenshot 2022-09-02 at 22 47 45

**Additional Context**

I am using iTerm2 but same occurs with default mac terminal. I am also using zsh with oh-my-zsh and powerlevel theme. This problem also goes away by clearing the terminal with "clear".

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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