[PR #6309] [MERGED] Add support for win32-input-mode to conhost, ConPTY, Terminal #26640

Open
opened 2026-01-31 09:17:17 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6309
Author: @zadjii-msft
Created: 6/2/2020
Status: ✅ Merged
Merged: 6/8/2020
Merged by: @undefined

Base: master ← Head: dev/migrie/f/4999-win32-input-mode


📝 Commits (10+)

  • e96fc60 Begin drafting spec for win32-input-mode
  • a2b28cf stashing this for now
  • 1a6ebbe Merge remote-tracking branch 'origin/master' into dev/migrie/s/4999-win32-input-mode
  • c570496 change it to a CSI because I like that better
  • 92e3aa9 Add a note about num lock
  • 981b4c4 Finish for review
  • eddcbe4 Add support to conhost for the proposed win32-input-mode
  • 583a3d2 Add suport to conpty to parse these sequences into KeyEvents
  • 2699f89 Make conpty request win32-input-mode on startup
  • 46a270d change terminator to '_', fix typos

📊 Changes

55 files changed (+619 additions, -66 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+4 -4)
📝 src/cascadia/PublicTerminalCore/HwndTerminal.hpp (+3 -3)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+4 -1)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+1 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+1 -1)
📝 src/cascadia/TerminalControl/TermControl.cpp (+43 -17)
📝 src/cascadia/TerminalControl/TermControl.h (+3 -1)
📝 src/cascadia/TerminalControl/TermControl.xaml (+1 -0)
📝 src/cascadia/TerminalCore/ITerminalApi.hpp (+1 -0)
📝 src/cascadia/TerminalCore/ITerminalInput.hpp (+1 -1)
📝 src/cascadia/TerminalCore/Terminal.cpp (+17 -4)
📝 src/cascadia/TerminalCore/Terminal.hpp (+2 -1)
📝 src/cascadia/TerminalCore/TerminalApi.cpp (+6 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.cpp (+16 -0)
📝 src/cascadia/TerminalCore/TerminalDispatch.hpp (+2 -0)
📝 src/cascadia/TerminalSettings/IControlSettings.idl (+3 -2)
📝 src/cascadia/TerminalSettings/ICoreSettings.idl (+2 -0)
📝 src/cascadia/TerminalSettings/terminalsettings.h (+3 -2)
📝 src/cascadia/UnitTests_TerminalCore/InputTest.cpp (+2 -1)
📝 src/cascadia/UnitTests_TerminalCore/MockTermSettings.h (+2 -0)

...and 35 more files

📄 Description

Adds support for win32-input-mode to conhost, conpty, and the Windows
Terminal.

  • The shared terminalInput class supports sending these sequences when
    a VT client application requests this mode.
  • ConPTY supports synthesizing INPUT_RECORDs from the input sent to it
    from a terminal
  • ConPTY requests this mode immediately on startup (if started with a
    new flag, PSEUDOCONSOLE_WIN32_INPUT_MODE)
  • The Terminal now supports sending this input as well, when conpty asks
    for it.

Also adds a new ConPTY flag PSEUDOCONSOLE_WIN32_INPUT_MODE which
requests this functionality from conpty, and the Terminal requests this
by default.

Also adds experimental.input.forceVT as a global setting to let a user
opt-out of this behavior, if they don't want it / this ends up breaking
horribly.

Validation Steps Performed

References #4999: The megathread
References #5887: The spec

Closes #879
Closes #2865
Closes #530
Closes #3079
Closes #1119
Closes #1694
Closes #3608
Closes #4334
Closes #4446


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/6309 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 6/2/2020 **Status:** ✅ Merged **Merged:** 6/8/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/4999-win32-input-mode` --- ### 📝 Commits (10+) - [`e96fc60`](https://github.com/microsoft/terminal/commit/e96fc60065d4faf8dfc3d52dcee1ee0e906ba124) Begin drafting spec for win32-input-mode - [`a2b28cf`](https://github.com/microsoft/terminal/commit/a2b28cf4ee78195555cd60a5502bc87fc082fe05) stashing this for now - [`1a6ebbe`](https://github.com/microsoft/terminal/commit/1a6ebbe1fa459884c3e776b80f01bc9d41732fa3) Merge remote-tracking branch 'origin/master' into dev/migrie/s/4999-win32-input-mode - [`c570496`](https://github.com/microsoft/terminal/commit/c570496c3141eb37fe976bf1c11e389453ceab91) change it to a CSI because I like that better - [`92e3aa9`](https://github.com/microsoft/terminal/commit/92e3aa99b0b008dffc5054ba7ccb4dea7600b225) Add a note about num lock - [`981b4c4`](https://github.com/microsoft/terminal/commit/981b4c4c4104dc5bc818851011e3a954b67b04b0) Finish for review - [`eddcbe4`](https://github.com/microsoft/terminal/commit/eddcbe434264fc3044d2d6ec5a94bb2c292f2b63) Add support to conhost for the proposed win32-input-mode - [`583a3d2`](https://github.com/microsoft/terminal/commit/583a3d2401b164dbf1b405e1c4686d30746865e9) Add suport to conpty to parse these sequences into KeyEvents - [`2699f89`](https://github.com/microsoft/terminal/commit/2699f89643c7643f5711140365ed2b2ad44a1f5c) Make conpty request win32-input-mode on startup - [`46a270d`](https://github.com/microsoft/terminal/commit/46a270dfe6a960c8581ac95d9b1087602e7dc9d7) change terminator to '_', fix typos ### 📊 Changes **55 files changed** (+619 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+4 -4) 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.hpp` (+3 -3) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+4 -1) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+1 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+1 -1) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+43 -17) 📝 `src/cascadia/TerminalControl/TermControl.h` (+3 -1) 📝 `src/cascadia/TerminalControl/TermControl.xaml` (+1 -0) 📝 `src/cascadia/TerminalCore/ITerminalApi.hpp` (+1 -0) 📝 `src/cascadia/TerminalCore/ITerminalInput.hpp` (+1 -1) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+17 -4) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+2 -1) 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+6 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.cpp` (+16 -0) 📝 `src/cascadia/TerminalCore/TerminalDispatch.hpp` (+2 -0) 📝 `src/cascadia/TerminalSettings/IControlSettings.idl` (+3 -2) 📝 `src/cascadia/TerminalSettings/ICoreSettings.idl` (+2 -0) 📝 `src/cascadia/TerminalSettings/terminalsettings.h` (+3 -2) 📝 `src/cascadia/UnitTests_TerminalCore/InputTest.cpp` (+2 -1) 📝 `src/cascadia/UnitTests_TerminalCore/MockTermSettings.h` (+2 -0) _...and 35 more files_ </details> ### 📄 Description Adds support for `win32-input-mode` to conhost, conpty, and the Windows Terminal. * The shared `terminalInput` class supports sending these sequences when a VT client application requests this mode. * ConPTY supports synthesizing `INPUT_RECORD`s from the input sent to it from a terminal * ConPTY requests this mode immediately on startup (if started with a new flag, `PSEUDOCONSOLE_WIN32_INPUT_MODE`) * The Terminal now supports sending this input as well, when conpty asks for it. Also adds a new ConPTY flag `PSEUDOCONSOLE_WIN32_INPUT_MODE` which requests this functionality from conpty, and the Terminal requests this by default. Also adds `experimental.input.forceVT` as a global setting to let a user opt-out of this behavior, if they don't want it / this ends up breaking horribly. ## Validation Steps Performed * played with this mode in vtpipeterm * played with this mode in Terminal * checked a bunch of scenarios, as outlined in a [comment] on #4999 [comment]: https://github.com/microsoft/terminal/issues/4999#issuecomment-628718631 References #4999: The megathread References #5887: The spec Closes #879 Closes #2865 Closes #530 Closes #3079 Closes #1119 Closes #1694 Closes #3608 Closes #4334 Closes #4446 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:17:17 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26640