bash 取消绑定 CTRL-W(bash 4.1 solaris 11.3)

bash 取消绑定 CTRL-W(bash 4.1 solaris 11.3)

我浏览过多个旧帖子,但没有任何作用。

我做了以下更改但无济于事:

#file: .inputrc

    set bind-tty-special-chars off #I have a cursory understanding of what this does, I really want to disable all mappings so I can build them from scratch myself


#file: .bashrc
    stty werase undef #again, just script kittying my way through this, no idea if this should be needed given that .inputrc has set bind-tty-special-chars off 
    bind -r "\C-w" #hoping this will unmap CTRL-W from all functions?
    bind -q unix-word-rubout #hoping this will remove unix-word-rubout functionality?

fwiw,除了在注释中或上面已经提到的之外,stty 不存在于任何启动文件中:grep stty .* .bashrc:stty werase undef .profile:#stty erasure ^H

我使用 SecureCRT 进行连接,虽然我在那里做了一些映射,但它没有 CTRL-W 的映射,当我按 CTRL-V CTRL-W 时,我得到:^W

有人可以指导我吗?谢谢!

答案1

答案是 .bashrc 仅在我手动运行 bash 时运行,它仅在交互式非登录时执行:(

将相同的命令添加到 .profile 即可

相关内容