我怎样才能在终端上写特定的单词(主要是GIT)?
How can I write specific words on terminal( mainly GIT)?
当我们按下向上箭头按钮时。它输入 "code."。当我们按下某个键时,我们可以写其他的词吗?我想在按下某个键时在终端上写 ./a.exe 。我们如何在 Visual studio 代码中做到这一点?
VS Code 中的集成终端在键绑定方面非常可定制。 official documentation 表示:
The workbench.action.terminal.sendSequence
command can be used to send
a specific sequence of text to the terminal, including escape
sequences. This enables things like sending arrow keys, enter, cursor
moves, etc. The example below shows the sorts of things you can
achieve with this feature, it jumps over the word to the left of the
cursor (Ctrl+Left arrow) and presses backspace:
{
"key": "ctrl+u",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u001b[1;5D\u007f" }
}
This feature supports variable substitution.
Note that the command only works with the \u0000 format for using
characters via their character code (not \x00).
当我们按下向上箭头按钮时。它输入 "code."。当我们按下某个键时,我们可以写其他的词吗?我想在按下某个键时在终端上写 ./a.exe 。我们如何在 Visual studio 代码中做到这一点?
VS Code 中的集成终端在键绑定方面非常可定制。 official documentation 表示:
The
workbench.action.terminal.sendSequence
command can be used to send a specific sequence of text to the terminal, including escape sequences. This enables things like sending arrow keys, enter, cursor moves, etc. The example below shows the sorts of things you can achieve with this feature, it jumps over the word to the left of the cursor (Ctrl+Left arrow) and presses backspace:{ "key": "ctrl+u", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[1;5D\u007f" } }
This feature supports variable substitution.
Note that the command only works with the \u0000 format for using characters via their character code (not \x00).