Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Request] Retrieve the partial user input on text prompt cancelation

Aperta
#407 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
nodejs, typescript
Ambito
cli

Direzione di ricerca

Inizia dal metodo text di @clack/prompts e dalla personalizzazione di TextPrompt menzionata nell’issue. Verifica se l’input parziale è disponibile quando si verifica l’annullamento, quindi definisci il risultato dell’annullamento in modo che i chiamanti possano recuperare un input non vuoto e distinguere annullamenti vuoti ripetuti; verifica che il comportamento esistente di TextPrompt rimanga invariato.

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

Descrizione

enhancement

Is your feature request related to a problem? Please describe.
Currently, when using the @clack/prompts text prompt, all that is returned is either the user entered value (if submitted) or the cancel symbol (if canceled). When the request is canceled, there is no way to know what the user had typed up to that point.

Describe the solution you'd like
I would like to get a way to retrieve what the user had for input when it canceled the request. This is to implement a feature similar to the node CLI, where canceling with a non-empty value clears the input, while canceling with an empty value twice in a row triggers an exit.

Describe alternatives you've considered
For now I have to treat empty and non-empty values in the same way. I was considering re-implementing the text method, but feels a lot of work (the great TextPrompt customization would need to be duplicated) and I'm not even sure if the data would be available there to begin with.

Lingua principale
TypeScript
Stelle
8.1k
Fork
217
Merge medio
1g 11h
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bombshell-dev/clack

Tutte le issue di bombshell-dev/clack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.