Repository navigation
fix: 主窗口按 Esc 也能关闭第二屏 - #3
Merged
Merged
Conversation
After opening the second screen, keyboard focus is handed back to the main window, and on macOS which window ends up focused is not deterministic. Esc only closed the output when the output window itself was focused; in the main window it just paused playback, so exiting felt unreliable. While the output is open, Esc in the main window (including the script editor) now closes it without changing playback. With no output open, Esc still pauses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
在 Mac 上开启第二屏输出后,按 Esc 退出不稳定。
原因
Esc 的效果取决于键盘焦点在哪个窗口:
打开第二屏后,程序会先聚焦第二屏、再把焦点交回主窗口,方便继续用快捷键控制。macOS 上这两次聚焦是异步的,最后落在哪个窗口不确定,所以 Esc 时灵时不灵。
修复
验证
npm run check通过🤖 Generated with Claude Code