Skip to content

Conversation

@zemaj
Copy link

@zemaj zemaj commented Oct 30, 2025

Summary

  • treat Windows AltGr (Control+Alt) key chords as printable characters so /, @, and other symbols insert correctly in the composer and terminal cells
  • keep Ctrl+Alt shortcuts (e.g., Ctrl+Alt+H delete word) by excluding ASCII letters from the AltGr path and add Windows-only regression tests
  • cover the change with new TextArea unit tests and a ComposerInput integration-style test to prevent future regressions

Testing

  • ./build-fast.sh
  • cargo test -p code-tui --test windows_altgr -- --ignored (fails: local cargo registry copy of cc 1.2.41 is missing generated modules; clear/update the registry and rerun on Windows)

Closes openai#5922.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +249 to +261
#[cfg(target_os = "windows")]
KeyEvent {
code: KeyCode::Char(c),
modifiers,
..
} if (modifiers == (KeyModifiers::CONTROL | KeyModifiers::ALT)
|| modifiers == (KeyModifiers::CONTROL
| KeyModifiers::ALT
| KeyModifiers::SHIFT))
&& !c.is_ascii_control()
&& !c.is_ascii_alphabetic() =>
{
self.insert_str(&c.to_string());

Choose a reason for hiding this comment

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

P1 Badge Allow AltGr chars in terminal pending commands

This branch makes TextArea::input treat Control+Alt key chords as printable on Windows, so the chat composer now works with AltGr. However, the terminal overlay still filters out every KeyCode::Char whenever any of CONTROL, ALT, or SUPER modifiers are set (terminal_handle_pending_key keeps returning handled = true without inserting the char). Pressing AltGr in terminal cells therefore remains impossible even after this change. If the goal is to permit AltGr everywhere, the terminal handler needs the same exception; otherwise the bug persists for terminal input.

Useful? React with 👍 / 👎.

@JKamsker
Copy link

Works on my machine (win 11, wt, ger keyboard)

Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Pulled the branch and exercised the new AltGr path. Highlights:

  • Verified the Control+Alt insertion branch only fires for non-alphabetic chars so Ctrl+Alt shortcuts (e.g. delete-word) still route through the existing handlers.
  • Added non-Windows TextArea + ComposerInput regression tests to prove Ctrl+Alt symbol chords stay suppressed on macOS/Linux while the Windows AltGr tests continue to pass.
  • Ran the targeted suites (, ) and Cache bucket: main-0d6e4079e367-63a036970bd9 (branch/worktree)
    Using rustup toolchain: 1.90.0
    rustc 1.90.0 (1159e78c4 2025-09-14)
    Building code binary (dev-fast mode)...
    Building bins: code
    ✅ Build successful!
    Binary location: /Users/zemaj/www/just-every/code/.code/working/_target-cache/code/main-0d6e4079e367-63a036970bd9/code-rs/dev-fast/code

Binary Hash: 8147106423b34c147e0e55765644fd2f7ddc35bc0da4469b4ac0f4f330183a83 (101M); all clean.
Remaining risk: Windows-only coverage still depends on CI/manual validation, so give the change a real keyboard smoke on Windows before merging.

Copy link
Author

@zemaj zemaj left a comment

Choose a reason for hiding this comment

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

Follow-up to avoid shell substitution noise in the earlier review comment.

  • Verified the Control+Alt insertion branch only fires for non-alphabetic chars so Ctrl+Alt shortcuts (e.g. delete-word) still route through the existing handlers.
  • Added non-Windows TextArea + ComposerInput regression tests to prove Ctrl+Alt symbol chords stay suppressed on macOS/Linux while the Windows AltGr tests continue to pass.
  • Ran the targeted suites (cargo test -p code-tui --features test-helpers --test non_windows_shortcuts, cargo test -p code-tui --features test-helpers --test windows_altgr) and ./build-fast.sh; all clean.
    Remaining risk: Windows-only coverage still depends on CI/manual validation, so give the change a real keyboard smoke on Windows before merging.

@zemaj zemaj merged commit ab6e442 into main Nov 7, 2025
14 checks passed
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.

Unable to use forward slash or @ in windows terminal

3 participants