[Bug] Multiselect leaves a stale prompt fragment after terminal resize with wrapped hints
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- node.js, typescript
Piste de recherche
Start by running the standalone @clack/prompts reproduction in repro.mjs with the resize sequence described, then inspect the multiselect renderer and frame erasure logic. Compare redraw behavior across terminal widths and check whether wrapped hints and rows scrolled out of view are accounted for. Done when resizing and pressing Down leaves only the current prompt visible; the issue names no repository source files or tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Environment
- OS: Ubuntu 24.04.5
- Node Version: 24.21.0
- Package:
@clack/prompts - Package Version: 1.8.1
Describe the bug
A multiselect prompt with long option hints leaves part of its previous frame at the top of the terminal after a width change and a navigation keypress. The active prompt continues to respond to Down and Ctrl-C, but the old text remains visible above it.
I reproduced this in a standalone @clack/prompts app with version 1.8.1, independent of Storybook. It occurs in tmux and in an xterm.js 5.5.0 PTY replay.
To Reproduce
package.json:
{"private":true,"type":"module","dependencies":{"@clack/prompts":"1.8.1"}}
repro.mjs
import { multiselect } from '@clack/prompts';
const options = [
'eslintPlugin',
'component-subtitle',
'argtypes-default-value',
'story-sort-to-main',
'remove-experimental-review',
'skills',
].map((label) => ({
value: label,
label,
hint: `Move deprecated parameters.componentSubtitle values to parameters.docs.subtitle\nMore info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#parameterscomponentsubtitle-removed`,
}));
await multiselect({
message: 'Select automigrations to run',
options,
initialValues: ['eslintPlugin'],
required: false,
});
Run npm install --no-audit --no-fund and node repro.mjs in a 120x40 terminal. Resize to 40x30, then press Down. A fragment of the old prompt stays at the top. Resize to 80x24 and press Down; the fragment persists. The current selection still moves, and Ctrl-C still works.
For a deterministic tmux replay:
tmux -L clack-resize new-session -d -x 120 -y 40 -s repro 'node repro.mjs'
tmux -L clack-resize resize-window -t repro -x 40 -y 30
tmux -L clack-resize send-keys -t repro Down
tmux -L clack-resize capture-pane -t repro -p
tmux -L clack-resize resize-window -t repro -x 80 -y 24
tmux -L clack-resize send-keys -t repro Down
tmux -L clack-resize capture-pane -t repro -p
Expected behavior
After each resize and redraw, the old prompt frame is fully cleared and only the current prompt is visible.
** Actual behavior **
The top row retains a fragment of the prior, wider frame (for example, the end of parameters.docs.subtitle). The current frame is drawn below it. The problem remains after widening the terminal again.
Additional Information
- Ubuntu 24.04.5; Node 24.21.0; npm 11.19.0; TERM=xterm-256color.
- Reproduced in tmux and in xterm.js 5.5.0.
- @clack/prompts 1.0.0-alpha.7 and 1.8.1 both reproduce.
- The renderer appears to recalculate the previous frame's wrapping using the new terminal width when erasing. Wrapped rows that have scrolled above the viewport cannot then be erased. The multiselect viewport also appears to count options without accounting for all visual rows used by wrapped hints. These are hypotheses from the reproducer, not a confirmed fix.
Related: PR #577 addresses multiselect line counts on narrow terminals, but I have not verified this resize sequence against that PR.
- Langage dominant
- TypeScript
- Étoiles
- 8.1k
- Forks
- 225
- Merge moyen
- 12 h 54 min
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de bombshell-dev/clack
-
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
bombshell-dev/clack#629 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Prompts never settle when stdin endsPeut-être pris @MFA-G l’a pris il y a 8 jours. Ouverte
Difficulté 3/5 Une demi-journée Accessibilité débutants 55/100
bombshell-dev/clack#615 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 70/100
bombshell-dev/clack#613 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
bombshell-dev/clack#597 ·
Les mainteneurs répondent en général sous 1 jour
-
rfc: accessible modeOuverteenhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
bombshell-dev/clack#585 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de bombshell-dev/clack
Issues similaires
-
backend refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
NIAEFEUP/tts#927 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
callstackincubator/react-native-harness#296 ·
Les mainteneurs répondent en général sous 1 jour
-
Editor bug with grouped nodesOuvertestatus:in-linear
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
n8n-io/n8n#42293 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
verified
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 5 jours
-
Add inputmode attribute support (forwarded to the inner input)Peut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Neovici/cosmoz-input#467 ·
Les mainteneurs répondent en général sous 1 jour