Vscode terminal shortcut key (clear screen) is invalid

background:

  • Vscode is automatically updated once every two weeks on average
  • The terminal clearing operation on the window becomes invalid after updating more than once
  • How to customize shortcut keys

Clear screen shortcut ctrl+k invalid

ctrl+LClear the screen is just transferred to the current line.
ctrl+kReally clear the screen. The effect is the same when it fails.ctrl+L

Correct according to the following steps: [Other shortcut keys method are the same]

step1:
Turn on 文件 > 首选项 > 键盘快捷方式 > keybindings.json

step2:
Add the following code to the edit json area on the right

{
    "key": "ctrl+k",
    "command": "workbench.action.terminal.clear",
    "when": "terminalFocus"
  }

Figure 1
Shortcut key customization
Figure 1

note:

1. This operation takes effect immediately, no need to restart
2. If it does not take effect, please use any other shortcut keys, such as: alt+u to check whether it takes effect, and then change back to ctrl+k after it takes effect

Guess you like

Origin blog.csdn.net/jianleking/article/details/84339124
Recommended