我正在运行 Ubuntu 16.04 并且 bash 一直在我的提示前放置“@”,无论~/.bashrc.
我尝试~/.bashrc使用export命令在文件中和终端中设置不同的值。
例如,这是我终端的一段:
@$ export PS1='HELLO '
@HELLO
Run Code Online (Sandbox Code Playgroud)
我什至尝试恢复到原来的~/.bashrc,但没有成功,因为 @ 仍然存在于每一行中。
您似乎已配置readline为启用编辑模式指示。来自Bash 参考手册的8.3.1 Readline Init File Syntax:
show-mode-in-prompt (Off)
If set to On, add a character to the beginning of the prompt
indicating the editing mode: emacs (@), vi command (:) or vi
insertion (+).
Run Code Online (Sandbox Code Playgroud)
您应该能够在当前 shell 中使用禁用它
bind 'set show-mode-in-prompt off'
Run Code Online (Sandbox Code Playgroud)
要坚持不懈地禁用它,你将需要找到它越来越设置,或者您的~/.inputrc或/etc/inputrc文件。