In bash, I use Ctrl + w to do so, but it is not working in my csh and instead of deleting a word, it is cleaning entire line. How to delete last word ?
Although Ctrl + u is working fine in both csh and bash.
I'm running csh inside screen (ubuntu).
In bash, I use Ctrl + w to do so, but it is not working in my csh and instead of deleting a word, it is cleaning entire line. How to delete last word ?
Although Ctrl + u is working fine in both csh and bash.
I'm running csh inside screen (ubuntu).
This works for me with tcsh: ALT
+ BACKSPACE
. Hope that helped!
Try this:
SHIFT
+ Alt
+ b
& Delete
you can check this list of keyboard shortcuts.
The action is named "backward-delete-word".
If you run the command >bindkey
in csh you will get all the keyboard shortcuts that apply to your shell.
You can >grep "backward-delete-word"
and you will get a result kinda like this:
>> bindkey | grep "backward-delete-word"
"^�" -> backward-delete-word
"^[^H" -> backward-delete-word
"^[^?" -> backward-delete-word
These results should be a combination of the default keybinds as well as custom ones if someone set them up.
I definitely have no idea what the first one means, but I can tell that ^[
means "meta-character", ^H
means ctrl+h (not ctrl+H which would be ctrl + shift + h) and ^?
means "backspace".
You can enter a meta character key by either pressing esc and letting go, or by pressing alt and keeping it pressed while you press on the other keys in the combination.
So the options that I (and probably you as well) have for delete-backward-word are:
alt+ctrl+h
esc->ctrl+h
alt+backspace
esc->backspace
and one mystery option.
To get Ctrl-w to delete words in csh like bash, add the following to ~/.cshrc
bindkey "^w" backward-delete-word
© 2022 - 2024 — McMap. All rights reserved.