[英]Is there any WORDCHARS alternative in Bash?
Conculusion:结论:
WORDCHARS
alternative in Bash, where Cw ends can't be configured. Bash 中没有WORDCHARS
替代项,其中无法配置Cw端。mysql
depends on editline
, which is customizable with ~/.editrc
. mysql
依赖于editline
,可以使用~/.editrc
进行自定义。redis-cli
depends on linenoise
, it deletes the whole word without considering :
, -
redis-cli
依赖linenoise
,它会删除整个单词而不考虑:
, -
In zsh, WORDCHARS
controls the behavior of Cw when deleting a word.在 zsh 中, WORDCHARS
控制Cw在删除单词时的行为。 Is there any alternative in readline? readline 有什么替代方案吗?
I've noticed recently the behavior of Cw in mysql
/ redis-cli
differs that in Bash, although both of which depends on readline
?我最近注意到mysql
/ redis-cli
中Cw的行为与 Bash 中的行为不同,尽管两者都取决于readline
?
Take string foo:bar
as an example, only bar
is deleted by Cw in Bash.以字符串foo:bar
为例,Bash 中只有bar
被Cw删除。 While in mysql
/ redis-cli
, the whole word foo:bar
is deleted.而在mysql
/ redis-cli
中,整个单词foo:bar
被删除。
How do I control this behavior?我该如何控制这种行为?
There are two commands to do backward kill word:有两个命令可以执行反向杀词:
backward-kill-word
unix-word-rubout
backward-kill-word
deletes bar
, unix-word-rubout
deletes foo:bar
backward-kill-word
删除bar
, unix-word-rubout
删除foo:bar
Run following command to find out what Cw
is bound to运行以下命令以找出Cw
绑定到的内容
bind -P | grep C-w
Seems bash doesn't have WORDCHARS as in zsh似乎 bash 没有 zsh 中的 WORDCHARS
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.