[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

feat(@clack/core): allow tab completion for placeholders (#146)

authored by

Christian Preston and committed by
GitHub
(Aug 24, 2023, 4:50 PM EDT) 24a3f4a2 7c7fde8d

+11
+5
.changeset/red-news-rule.md
··· 1 + --- 2 + '@clack/core': patch 3 + --- 4 + 5 + feat(@clack/core): allow tab completion for placeholders
+6
packages/core/src/prompts/prompt.ts
··· 166 166 if (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) { 167 167 this.emit('confirm', char.toLowerCase() === 'y'); 168 168 } 169 + if (char === '\t' && this.opts.placeholder) { 170 + if (!this.value) { 171 + this.rl.write(this.opts.placeholder); 172 + this.emit('value', this.opts.placeholder); 173 + } 174 + } 169 175 if (char) { 170 176 this.emit('key', char.toLowerCase()); 171 177 }