Implement CTRL+BACKSPACE word-deletion #8332

Closed
opened 2026-01-31 01:26:41 +00:00 by claunia · 5 comments
Owner

Originally created by @DarthJahus on GitHub (May 20, 2020).

Actually (Terminal 1.0.1401.0), if you use CTRL+LEFT or CTRL+LEFT, you correctly move between words. However, CTRL+BACKSPACE does not delete the previous word, even though CTRL+DEL does delete the next word.

Since the latter is implemented, it would be great (and more useful) to implement CTRL+BACKSPACE.

Odly, CMD.exe has CTRL+BACKSPACE but doesn't support CTRL+DEL 😄.

Thank you.

Originally created by @DarthJahus on GitHub (May 20, 2020). Actually (Terminal `1.0.1401.0`), if you use `CTRL+LEFT` or `CTRL+LEFT`, you correctly move between words. However, `CTRL+BACKSPACE` does not delete the previous word, even though `CTRL+DEL` does delete the next word. Since the latter is implemented, it would be great (and more useful) to implement `CTRL+BACKSPACE`. Odly, `CMD.exe` has `CTRL+BACKSPACE` but doesn't support CTRL+DEL 😄. Thank you.
Author
Owner

@zadjii-msft commented on GitHub (May 20, 2020):

This is typically a feature that the shell needs to implement, not the Terminal. As you've correctly identified, cmd does support deleting the previous word on ctrl+bksp.

Which shell are you using?

@zadjii-msft commented on GitHub (May 20, 2020): This is typically a feature that the _shell_ needs to implement, not the Terminal. As you've correctly identified, `cmd` does support deleting the previous word on <kbd>ctrl+bksp</kbd>. Which shell are you using?
Author
Owner

@DarthJahus commented on GitHub (May 20, 2020):

Oh. Right. Even if I open CMD inside Terminal, it has CTRL+BACKSPACE. The shell I'm using is the default WSL shell:
image
Should I take this to Microsoft/WSL?

@DarthJahus commented on GitHub (May 20, 2020): Oh. Right. Even if I open CMD inside Terminal, it has `CTRL+BACKSPACE`. The shell I'm using is the default WSL shell: ![image](https://user-images.githubusercontent.com/7353366/82446669-f4c0ae80-9a9e-11ea-8d78-d247a86cae08.png) Should I take this to [Microsoft/WSL](https://github.com/microsoft/WSL/)?
Author
Owner

@dreadnaut commented on GitHub (May 20, 2020):

Shortcuts in WSL depend on the shell that Linux is using. Most of them support "readline" shortcuts.
Readline shortcuts

@dreadnaut commented on GitHub (May 20, 2020): Shortcuts in WSL depend on the shell that Linux is using. Most of them support "readline" shortcuts. ![Readline shortcuts](https://discuss.as3lang.org/uploads/default/original/2X/0/0efb1756b52b0f4a9d86cc7f320f1269878986e8.jpeg)
Author
Owner

@zadjii-msft commented on GitHub (May 20, 2020):

No need, you'll just need to configure it with whatever shell you're using in WSL. For me, I use bash, so I've added the following to my ~/.bashrc:

bind '"\C-h":backward-kill-word'

image

@zadjii-msft commented on GitHub (May 20, 2020): No need, you'll just need to configure it with whatever shell you're using in WSL. For me, I use `bash`, so I've added the following to my `~/.bashrc`: ```sh bind '"\C-h":backward-kill-word' ``` ![image](https://user-images.githubusercontent.com/18356694/82448637-9e884700-9a6f-11ea-826b-d842a8f6257c.png)
Author
Owner

@DarthJahus commented on GitHub (May 20, 2020):

Amazing, thank you, @zadjii-msft. Added that and it's working.

And thank you @dreadnaut for the shortcut sheet.

@DarthJahus commented on GitHub (May 20, 2020): Amazing, thank you, @zadjii-msft. Added that and it's working. And thank you @dreadnaut for the shortcut sheet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8332