Skip to content

[codex] fix terminal Mac Option symbols#96

Closed
jimmystridh wants to merge 3 commits into
debuglebowski:mainfrom
jimmystridh:dollar-usage-on-mac
Closed

[codex] fix terminal Mac Option symbols#96
jimmystridh wants to merge 3 commits into
debuglebowski:mainfrom
jimmystridh:dollar-usage-on-mac

Conversation

@jimmystridh
Copy link
Copy Markdown
Contributor

Problem

On macOS, the embedded terminal did not allow keyboard-layout characters produced with the Option key. In practice this meant users could not type currency symbols such as Option+3 for $ or Option+4 for in the terminal.

Root cause

The xterm instance was created with macOptionIsMeta: true. That makes xterm treat Option as Meta and convert Option-key input into escape/meta sequences instead of allowing macOS keyboard layouts to emit printable characters.

Fix

  • Set macOptionIsMeta to false for new terminal instances so Option remains available for printable layout characters.
  • Apply the same option when cached terminal instances are reattached, so existing xterm caches pick up the behavior.
  • Keep Option+Left and Option+Right word navigation through the existing custom key handler.
  • Add an e2e guard that asserts the terminal keeps macOS Option available for printable characters.

Validation

  • pnpm --filter @slayzone/app build
  • pnpm --filter @slayzone/terminal typecheck
  • pnpm --filter @slayzone/app exec playwright test --config playwright.config.ts e2e/terminal/30-terminal-core-behavior.spec.ts -g "lets macOS Option"

@jimmystridh
Copy link
Copy Markdown
Contributor Author

Superseded by #97. This first PR was opened from an existing local branch that contained unrelated older commits, so I replaced it with a clean branch based on main.

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