Search code examples
terminalvisual-studio-codezsh

How do I move the cursor to the beginning of the line in VSCode's terminal?


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?


Solution

  • 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.