Remapping Default Console Keys #5770

Closed
opened 2026-01-31 00:21:13 +00:00 by claunia · 1 comment
Owner

Originally created by @FancyKillerPanda on GitHub (Jan 5, 2020).

Description of the new feature/enhancement

Having the ability to remap the default keys of the host console (CMD, Powershell, etc.). Right now, it is only possible to remap some keys from the Windows Terminal UI. One example of a key I'd like to be able to remap is F8, which in Command Prompt cycles through the history based on the characters you've already typed. I'd like to remap it to something like ctrl+up.

If you know of a workaround for this, it'd be much appreciated if you let me know.

Proposed technical implementation details (optional)

The code currently calls _cycleMatchingCommandHistoryToPrompt when it detects a VK_F8 event. It might be possible to allow this to be changed dynamically.

Originally created by @FancyKillerPanda on GitHub (Jan 5, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Having the ability to remap the default keys of the host console (CMD, Powershell, etc.). Right now, it is only possible to remap some keys from the Windows Terminal UI. One example of a key I'd like to be able to remap is `F8`, which in Command Prompt cycles through the history based on the characters you've already typed. I'd like to remap it to something like `ctrl+up`. If you know of a workaround for this, it'd be much appreciated if you let me know. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) The code currently calls `_cycleMatchingCommandHistoryToPrompt` when it detects a `VK_F8` event. It might be possible to allow this to be changed dynamically. <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-31 00:21:14 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 9, 2020):

Hey @FancyKillerPanda! Thanks for the investigation and for the feature request. This is a tough nut, though it might not seem like that on the surface. Here's what's up.

Those key bindings (F6-F9) are part of a legacy part of the console host we all wish we'd never committed to. Back in what feels like 1965 a decision was made: that the console host would store command history and aliases and handle a "cooked" line discipline on behalf of any console application that asks for it.

Since people view those behaviors as being so deeply intertwined with CMD and PowerShell, we can't rip them out of conhost and move them into the shells where they belong. Since they're so deeply integrated in conhost, however, we have to give them a cautious berth. I'm not likely to greenlight work to make them configurable in conhost.

Now, here's the rub. "Conhost isn't terminal!" you might protest. This is where the lines blur a little bit. Terminal doesn't have any idea what the result of sending F8 or Ctrl+Up or what-have-you is going to be. It's not secretly telling conhost that it should pop up the history dialog... it's just telling it "hey the user pressed F8" (which I presume you already know, but I'm in exposition mode) so on the flipside of that, there's no way to tell it not to pop up the history dialog without plumbing a new configuration option down into conhost and a bit of infrastructure to support it. That'd have to come after all the other "we need to be able to tell conhost x, y, or z" issues (like #1882, which needs to tell its nested conhost that "hey the user wanted to delete the buffer, you keen?)

All that to say- this one probably won't make the cut, so I'm going to close it out with an unfortunate Won't Fix. Sorry!

@DHowett-MSFT commented on GitHub (Jan 9, 2020): Hey @FancyKillerPanda! Thanks for the investigation and for the feature request. This is a tough nut, though it might not seem like that on the surface. Here's what's up. Those key bindings (<kbd>F6</kbd>-<kbd>F9</kbd>) are part of a legacy part of the console host we all wish we'd never committed to. Back in what feels like 1965 a decision was made: that the _console host_ would store command history and aliases and handle a "cooked" line discipline on behalf of any console application that asks for it. Since people view those behaviors as being so deeply intertwined with CMD and PowerShell, we can't rip them out of conhost and move them into the shells where they belong. Since they're so deeply integrated in _conhost_, however, we have to give them a cautious berth. I'm not likely to greenlight work to make them configurable in conhost. Now, here's the rub. "Conhost isn't terminal!" you might protest. This is where the lines blur a little bit. Terminal doesn't have any idea what the result of sending <kbd>F8</kbd> or <kbd>Ctrl+Up</kbd> or what-have-you is going to be. It's not secretly telling conhost that it should pop up the history dialog... it's just telling it "hey the user pressed <kbd>F8</kbd>" (which I presume you already know, but I'm in exposition mode) so on the flipside of that, there's no way to tell it _not_ to pop up the history dialog without plumbing a new configuration option down into conhost and a bit of infrastructure to support it. That'd have to come after all the other "we need to be able to tell conhost x, y, or z" issues (like #1882, which needs to tell its nested conhost that "hey the user wanted to delete the buffer, you keen?) All that to say- this one probably won't make the cut, so I'm going to close it out with an _unfortunate_ Won't Fix. Sorry!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5770