Skip to main content
added 9 characters in body
Source Link
Stéphane Chazelas
  • 585.1k
  • 96
  • 1.1k
  • 1.7k

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xD8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then XBackspace, or you can set convert-meta to on in the readline configuration (for instance with bind 'set convert-meta onon'), but then you won't be able to input non-ascii characters.

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xD8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then X, or you can set convert-meta to on in the readline configuration (for instance with bind 'set convert-meta on), but then you won't be able to input non-ascii characters.

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xD8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then Backspace, or you can set convert-meta to on in the readline configuration (for instance with bind 'set convert-meta on'), but then you won't be able to input non-ascii characters.

added 106 characters in body
Source Link
Stéphane Chazelas
  • 585.1k
  • 96
  • 1.1k
  • 1.7k

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xC80xD8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then X, or you can set convert-meta to on in the readline configuration (for instance with bind 'set convert-meta on), but then you won't be able to input non-ascii characters.

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xC8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then X, or you can set convert-meta to on in the readline configuration.

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xD8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then X, or you can set convert-meta to on in the readline configuration (for instance with bind 'set convert-meta on), but then you won't be able to input non-ascii characters.

Source Link
Stéphane Chazelas
  • 585.1k
  • 96
  • 1.1k
  • 1.7k

bind -p gives you the current bindings. You'll find that Ctrl+W is bound to unix-word-rubout and Alt+D to kill-word:

"\C-w": unix-word-rubout
"\ed": kill-word

If you do a bind -p | grep kill-word, you'll find:

"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word

Some terminals send ^H upon Backspace and some other ^? which is why there are two bindings. That makes it that Alt+Backspace should be what kills a word backward at least on those terminals where Alt+X sends the ESC character followed by X.

There are some terminals however that send X with the 8th bit set (0xC8) upon Alt+X (though they are becoming rarer and rarer, as that doesn't make much sense this new UTF-8 world). In those, you'll have to press Esc and then X, or you can set convert-meta to on in the readline configuration.