Skip to content

Add comprehensive tests for alt+shift+letter keyboard combinations#5349

Merged
Tyriar merged 3 commits intomasterfrom
copilot/fix-3382
Jun 5, 2025
Merged

Add comprehensive tests for alt+shift+letter keyboard combinations#5349
Tyriar merged 3 commits intomasterfrom
copilot/fix-3382

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 5, 2025

This PR adds comprehensive test coverage for alt+shift+letter keyboard combinations that were missing from the test suite.

Background

Issue #3382 reported that alt+shift+h was producing ^[h (lowercase) instead of the expected ^[H (uppercase) behavior. However, upon investigation, the current codebase already handles this correctly:

  • alt+shift+h correctly produces \x1bH (uppercase)
  • alt+h correctly produces \x1bh (lowercase)

The original issue reporter confirmed in a recent comment (June 2025) that the behavior is working correctly in current VS Code versions, suggesting the fix was implemented sometime between 2021 (when reported) and now.

Changes Made

Added comprehensive test cases covering:

  • Alt+shift+letter combinations producing uppercase letters (\x1bA, \x1bH, \x1bZ)
  • Alt+letter combinations (without shift) producing lowercase letters (\x1ba, \x1bh, \x1bz)
  • Multiple letter combinations to ensure consistency across the alphabet

Testing

The new tests verify that the keyboard handling logic in Keyboard.ts (lines 331-337) correctly:

  1. Processes letter keyCodes (65-90) when alt is pressed
  2. Respects the shift key state to determine case
  3. Returns the proper escape sequence format

All tests pass, confirming the issue has been resolved and proper behavior is maintained.

Fixes #3382.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Can not handle uppercase keys, such as alt+shift+h Add comprehensive tests for alt+shift+letter keyboard combinations Jun 5, 2025
Copilot AI requested a review from Tyriar June 5, 2025 10:25
Copilot finished work on behalf of Tyriar June 5, 2025 10:25
@Tyriar
Copy link
Copy Markdown
Member

Tyriar commented Jun 5, 2025

@copilot fix up CI:

/home/runner/work/xterm.js/xterm.js/src/common/input/Keyboard.test.ts
Warning:   345:1  warning  Trailing spaces not allowed  no-trailing-spaces
ESLint found too many warnings (maximum: 0).

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 5, 2025

@copilot fix up CI:

...

Fixed ESLint trailing spaces warning by removing trailing spaces from line 345 in Keyboard.test.ts. Commit 076f051.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://168.63.129.16:80/machine/
    • Triggering command: /usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of Tyriar June 5, 2025 10:35
@Tyriar Tyriar marked this pull request as ready for review June 5, 2025 10:40
@Tyriar Tyriar added this to the 6.0.0 milestone Jun 5, 2025
@Tyriar Tyriar enabled auto-merge June 5, 2025 10:41
@Tyriar Tyriar merged commit ee0a3de into master Jun 5, 2025
12 checks passed
@Tyriar Tyriar deleted the copilot/fix-3382 branch June 5, 2025 10:47
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.

Can not handle uppercase keys, such as alt+shift+h

2 participants