Skip to content

Handle focus reporting race#156

Merged
tfpf merged 9 commits into
mainfrom
focus-race
Apr 22, 2026
Merged

Handle focus reporting race#156
tfpf merged 9 commits into
mainfrom
focus-race

Conversation

@tfpf
Copy link
Copy Markdown
Owner

@tfpf tfpf commented Apr 22, 2026

  • Disable focus reporting after reading standard input
    • Some slow terminals may batch process the enable and disable requests if they are sent in succession.
    • The terminal may then not send focus escape sequences at all.
  • Make the standard input read time out from the start of the read instead of after a byte is available
    • The aforementioned slow terminals may not send escape sequences, so the read will then block forever.
  • Check for errors getting or setting terminal attributes before enabling focus reporting
  • Clear standard input before enabling focus reporting

tfpf added 9 commits April 23, 2026 01:25
* Disable focus reporting after reading standard input
  * Some slow terminals may batch process the enable and disable requests if they are sent in succession.
  * The terminal may then not send focus escape sequences at all.
* Make the standard input read time out from the start of the read instead of after a byte is available
  * The aforementioned slow terminals may not send escape sequences, so the read will then block forever.
* Check for errors getting or setting terminal attributes before enabling focus reporting
@tfpf tfpf merged commit 3a9fd44 into main Apr 22, 2026
9 checks passed
@tfpf tfpf deleted the focus-race branch April 22, 2026 20:57
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.

1 participant