Skip to content

Fix Windows Ctrl+J key event in ConPTY#13120

Closed
AndreKalberer wants to merge 1 commit into
warpdotdev:masterfrom
AndreKalberer:andrekalberer/fix-windows-ctrl-j-key-event
Closed

Fix Windows Ctrl+J key event in ConPTY#13120
AndreKalberer wants to merge 1 commit into
warpdotdev:masterfrom
AndreKalberer:andrekalberer/fix-windows-ctrl-j-key-event

Conversation

@AndreKalberer

@AndreKalberer AndreKalberer commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes ConPTY input encoding for Ctrl-letter chords when an application enables Windows Terminal's private Win32 input mode (CSI ? 9001 h). Warp now tracks that mode and emits Win32 input record sequences for Ctrl+A-Z, preserving the original virtual key. This keeps Ctrl+J as VK_J instead of letting downstream clients infer Enter from the LF control character.

Linked Issue

Closes #11688

  • The linked issue is labeled ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

Testing

  • Added parser coverage for private Win32 input mode (CSI ? 9001 h).

  • Added regression coverage that Ctrl+J emits VK_J in Win32 input mode.

  • cargo fmt - cargo test -p warp_terminal

  • cargo check -p warp --tests

  • cargo clippy -p warp_terminal --tests -- -D warnings

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos Ctrl+J validation video:

Screen.Recording.2026-07-01.173407.mp4

The PR build reports:

  • wVirtualKeyCode=0x004a (VK_J)
  • uChar=0x000a (LF)
  • PASS: Ctrl+J is reported as VK_J with LF.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed Ctrl+J in Codex CLI on Windows being reported as Ctrl+Enter.

Encode Ctrl-letter chords as Win32 input records when ConPTY enables private Win32 input mode so Ctrl+J preserves VK_J instead of being inferred as Enter from LF.
@cla-bot cla-bot Bot added the cla-signed label Jun 27, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Jun 27, 2026
@AndreKalberer
AndreKalberer marked this pull request as ready for review June 27, 2026 01:31
@oz-for-oss

oz-for-oss Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@AndreKalberer

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @acarl005.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot 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.

Overview

This PR adds support for Windows Terminal's private Win32 input mode in the terminal parser/model and emits Win32 input record sequences for Ctrl+A-Z chords so Ctrl+J preserves VK_J instead of being inferred as Enter.

Concerns

  • No blocking correctness, security, or spec-alignment concerns found in the attached diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss
oz-for-oss Bot requested a review from acarl005 June 27, 2026 01:34

@acarl005 acarl005 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.

@AndreKalberer Thanks for submitting the fix. Please upload a video demonstrating that ctrl+j works as intended and then I'll review.

@AndreKalberer

Copy link
Copy Markdown
Contributor Author

Video demonstrating Ctrl+J in the PR build:

  • wVirtualKeyCode=0x004a (VK_J)
  • uChar=0x000a (LF)
  • probe reports PASS: Ctrl+J is reported as VK_J with LF.

Video file to upload:

Screen.Recording.2026-07-01.173407.mp4

@acarl005
acarl005 self-requested a review July 2, 2026 05:04
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Hi @AndreKalberer — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 14 days of inactivity.

@AndreKalberer

Copy link
Copy Markdown
Contributor Author

@acarl005 I uploaded the requested Ctrl+J demo above and added it to the PR description. The video shows the PR build reporting wVirtualKeyCode=0x004a (VK_J) with uChar=0x000a (LF), and the probe passes. Let me know if you need any other validation.

@acarl005

acarl005 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@AndreKalberer Sorry review is taking so long. I wasn't expecting the fix to entail adding recognition for a whole new input protocol. It's deeper than I expected. I'll have to get to this next week.

@acarl005

Copy link
Copy Markdown
Contributor

It was my mistake to label this as ready-to-implement. This is a very risky change. ConPTY unconditionally requests the Win32 input mode on all sessions upon creation. Recognizing this sequence will enable this input mode for all Windows users for all sessions, not just when using Codex (what the original issue was about). Furthermore, this PR only implements a small part of the protocol (Win32 input mode).

@acarl005 acarl005 closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Ctrl+J is reported as Ctrl+Enter in Codex CLI because Warp emits VK_RETURN for KEY_EVENT_RECORD

2 participants