We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c7fde8 + 4f6fcf5 commit 24a3f4aCopy full SHA for 24a3f4a
.changeset/red-news-rule.md
@@ -0,0 +1,5 @@
1
+---
2
+'@clack/core': patch
3
4
+
5
+feat(@clack/core): allow tab completion for placeholders
packages/core/src/prompts/prompt.ts
@@ -166,6 +166,12 @@ export default class Prompt {
166
if (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {
167
this.emit('confirm', char.toLowerCase() === 'y');
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
175
if (char) {
176
this.emit('key', char.toLowerCase());
177
0 commit comments