Phi*_*ppe 5 terminal windows-subsystem-for-linux
# When I do just Shift-Insert, I get
~$ 2~
# When I do Ctrl-V, then Shift-Insert, I get
~$ ^[[2;2~
Run Code Online (Sandbox Code Playgroud)
Shift-insert 在其他情况下也能很好地工作,比如 Windows CMD 或 Git-Bash
在 wsl 中,我可以使用 Ctrl-Shift-V 进行粘贴,但更喜欢使用 shift-insert。
有什么解决办法吗?
据microsoft/WSL报道:
\n\n\n请注意,WSL 发行版在 Windows 控制台中启动(除非您已采取措施启动第 3 方控制台/终端)。因此,请在Windows 控制台问题跟踪器中记录 UI/UX 相关问题。
\n
但Windows 控制台的给定链接指向Windows 终端:
\n\n\n新的 Windows 终端和原来的 Windows 控制台主机都在同一个地方!
\n
没有(可用的)文档,因此必须通过指向其源代码来回答您的问题。
\n相关的块(你想要练习的)在这里,在windowio.cpp:
// handle shift-ins paste\n if (inputKeyInfo.IsShiftOnly() && ShouldTakeOverKeyboardShortcuts())\n {\n if (!bKeyDown)\n {\n return;\n }\n else if (VirtualKeyCode == VK_INSERT && !(pSelection->IsInSelectingState() && pSelection->IsKeyboardMarkSelection()))\n {\n Clipboard::Instance().Paste();\n return;\n }\n }\nRun Code Online (Sandbox Code Playgroud)\n一半的条件(达到该条件Paste())似乎可能得到满足(除非该程序中存在一些错误)。那些不明显的:
ShouldTakeOverKeyboardShortcuts()\xe2\x80\x94 但这在ctrl+shift+加/减代码中使用
pSelection->IsKeyboardMarkSelection()\xe2\x80\x94 我们假设使用鼠标进行选择。
但这是假设此HandleKeyEvent方法平等对待两个不同的按键序列。来自^[[2;2~程序的另一部分,在 中terminalInput.cpp,使用内置表
// Sequences to send when a modifier is pressed with any of these keys\n// Basically, the \'m\' will be replaced with a character indicating which\n// modifier keys are pressed.\nstatic constexpr std::array<TermKeyMap, 22> s_modifierKeyMapping{\nRun Code Online (Sandbox Code Playgroud)\n并在这里应用:
\n// If a modifier key was pressed, then we need to try and send the modified sequence.\nif (keyEvent.IsModifierPressed() && _searchWithModifier(keyEvent, senderFunc))\n{\n return true;\n}\nRun Code Online (Sandbox Code Playgroud)\n从阅读代码来看,这似乎都是逻辑的上游windowio.cpp,因此永远不会达到组合。开发人员没有提供覆盖或修改此行为的方法。
正如 @Rody-Oldenhuis 的评论中所建议的:
\n\n\n您可以使用wsltty;这支持开箱即用的 Ctrl+Ins/Shift-Ins
\n
(源自薄荷)。
\n| 归档时间: |
|
| 查看次数: |
1315 次 |
| 最近记录: |