Skip to content

Conversation

@majiayu000
Copy link

Fixes #4524

Summary

When execute is triggered via HTTP POST, fzf's GetChar() goroutine was already blocking on tty read. Any keystroke intended for the executed command (e.g., 'q' to quit less) was captured by the blocking GetChar call instead of going to the subprocess.

Changes

  • Track when actions originate from external source (HTTP POST via serverInputChan)
  • Drain any captured keystroke from keyChan after execute completes for external actions
  • Reset the flag at end of each loop iteration

🤖 Generated with Claude Code

When an execute action is triggered via HTTP POST (external source), fzf's
GetChar() goroutine was already blocking on tty read. Any keystroke intended
for the executed command might have been captured by the blocking GetChar
call instead of going to the subprocess.

This fix:
1. Tracks when actions come from external sources (HTTP POST via
   serverInputChan)
2. After execute completes for external actions, drains any captured
   keystroke from keyChan with a short timeout
3. Resets the flag at the end of each loop iteration

Fixes junegunn#4524

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
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.

Problem using 'execute' action invoked via HTTP POST-request

1 participant