Skip to content

macOS: fix non control keys are not working for AppleScript#13205

Open
bo2themax wants to merge 1 commit into
ghostty-org:mainfrom
bo2themax:push-0f19080e
Open

macOS: fix non control keys are not working for AppleScript#13205
bo2themax wants to merge 1 commit into
ghostty-org:mainfrom
bo2themax:push-0f19080e

Conversation

@bo2themax

@bo2themax bo2themax commented Jul 5, 2026

Copy link
Copy Markdown
Member

send key only works for control keys like enter currently; this adds (fixes) the support for other keys listed as available. Found by @paaloeye in #13180

The core of this fix is relying on UCKeyTranslate to get the corresponding character and code point from a key code using characters(byApplyingModifiers:). To reuse the existing code point check in ghosttyCharacters, I moved that into a separate function to avoid unexpected side effects.

Not sure which case could break if I just use characters(byApplyingModifiers:) regardlessly.

AI Disclosure

Claude wrote the unit tests and did some code review.

Tests seems flaky on ci, deleted it

@paaloeye paaloeye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well done!

Tested it in my harness and it works as expected.

Test command: gtty surface broadcast --engine swift --offset -3..-1.
One would need four surfaces and Nushell installed.

@paaloeye

Copy link
Copy Markdown
Contributor

I've been daily driving Ghostty with that — couldn't find any problems with it.
@bo2themax Is anything missing here? It wasn't trivial to discover using send key with anything other than enter, IMO it's worth updating the docs. I'm happy to give it go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants