I have my terminal set to zsh, and in iTerm2 I can press ctrl+e
to move my cursor to the end of the line, and ctrl+a
to move to the beginning. In VSCode, this just prints out a literal ^E^A
. Is there a setting I need to allow terminal to respond to emacs style commands?
Try these keybindings:
{
"key": "ctrl+e",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u0005" }, // move cursor to end of line, sends ctrl+e to terminal
"when": "terminalFocus"
},
{
"key": "ctrl+a",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u0001" }, // move cursor to start of line, sends ctrl+a to terminal
"when": "terminalFocus"
},
Works in bash, I can't test in zsh but it should work.
As was mentioned in a comment above:
Open ~/.zshrc
, and add this line to the end:
bindkey -e
I'm unclear why this works automatically for zsh in iTerm, but must be manually set to work with zsh in VSCode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With