Skip to content

Add asking state and buffer terminal output#19

Merged
shellicar merged 1 commit intomainfrom
feature/prompt-display-improvements
Feb 20, 2026
Merged

Add asking state and buffer terminal output#19
shellicar merged 1 commit intomainfrom
feature/prompt-display-improvements

Conversation

@shellicar
Copy link
Copy Markdown
Owner

Summary

  • Add 'asking' phase to AppState for AskUserQuestion prompts with elapsed timer
  • Separate 'prompting' (permissions, externally timed) from 'asking' (questions, self-timed)
  • Buffer all terminal output into single write calls to eliminate flicker

@shellicar shellicar enabled auto-merge (squash) February 20, 2026 05:25
Copy link
Copy Markdown
Collaborator

@bananabot9000 bananabot9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, focused PR. Two distinct changes that both make sense:

1. asking phase — good separation

Splitting prompting (permissions, externally timed) from asking (questions, self-timed) is the right call. The user experience is different — permissions have their own countdown, questions need an elapsed timer to show "hey, this is waiting on you". The asking() method follows the same pattern as thinking() with setInterval + emit('changed'), so it's consistent.

The prompt label format ${q.header}: Select [1-${q.options.length + 1}] in the status line is a nice touch — immediately tells the user what's expected without them needing to scroll up to the question.

2. Buffered terminal writes — solid fix

The refreshSticky()buildSticky() refactor is the real gem here. Previously you had:

process.stdout.write(output);  // write content
this.refreshSticky();          // separate write for sticky zone

Now it's:

output += this.buildSticky();
process.stdout.write(output);  // single atomic write

This eliminates the flicker from two sequential writes where the terminal could render the intermediate state (content without sticky zone). Single write() call = single frame. Clean.

This pattern is applied consistently across writeHistory(), refresh(), and updateEditor() — good that nothing was missed.

No concerns

Small, well-scoped, consistent with existing patterns. 🍌

@shellicar shellicar merged commit f42f7cb into main Feb 20, 2026
2 checks passed
@shellicar shellicar deleted the feature/prompt-display-improvements branch February 20, 2026 05:26
@shellicar shellicar added this to the 1.0.0 milestone Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants