Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete the prior word with VS Code terminal

In my standard MacOS terminal, alt+delete deletes to the prior word, but in the VS Code embedded terminal it deletes to the prior space. Bizarrely, alt+left correctly moves the cursor to the prior word. For example, given foo bar.baz before the cursor, alt+delete will delete bar.baz while alt+left will move the cursor to the start of baz. Is there a way to get the proper delete-word functionality?

like image 951
weberc2 Avatar asked Dec 07 '25 17:12

weberc2


1 Answers

Combine what's suggested by Mark and RxJx, set alt+backspace to deleteWordPartLeft work's for me on macOS.

{
    "key": "alt+backspace",
    "command": "workbench.action.terminal.deleteWordPartLeft", 
    "when": "terminalFocus"
},
like image 119
ushuz Avatar answered Dec 09 '25 11:12

ushuz