在 Linux Ubuntu 11.04 上,每个命令(cd、ls、vim……)执行成功或失败后,tmux
都会打印出最后一行ps1_update: command not found
。
我是否遗漏了任何配置选项?
非常感谢!
tmux.conf
# http://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily
# just remember that after every modification, tmux must be refreshed
# to take new settings into account.
# This can be achieved either by restarting it or by typing in:
# tmux source-file .tmux.conf
# Here is a list of a few basic tmux commands:
# Ctrl+b " - split pane horizontally.
# Ctrl+b % - split pane vertically.
# Ctrl+b arrow key - switch pane.
# Hold Ctrl+b, don't release it and hold one of the arrow keys - resize pane.
# !Ctrl+b c - (c)reate a new window.
# !Ctrl+b n - move to the (n)ext window.
# Ctrl+b p - move to the (p)revious window.
# Shift+LMB - select text.
# ALT+Arrows to move among panes.
# rebind default prefix to C-a
unbind C-b
set -g prefix C-a
# use ALT+Arrows to move around panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# highlight current pane
set-window-option -g window-status-current-bg yellow
# enable pane switching with mouse
set-option -g mouse-select-pane on
# read bashrc
source ~/.bashrc
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
命令行打印输出
($(cat)user@tiki:~/.vim$ ls
autoload bash_profile bashrc bundle README.md tmux.conf vimrc xmonad xmonad-ubuntu-conf xsessionrc
ps1_update: command not found
($(cat)user@tiki:~/.vim$ ll
total 56
drwxrwxr-x 2 user user 4096 Mar 17 10:20 autoload/
-rw-rw-r-- 1 user user 170 Mar 17 10:20 bash_profile
-rw-rw-r-- 1 user user 4004 Apr 2 11:37 bashrc
drwxrwxr-x 20 user user 4096 Aug 20 10:55 bundle/
-rw-rw-r-- 1 user user 11170 Aug 20 11:24 README.md
-rw-rw-r-- 1 user user 1243 Mar 17 10:20 tmux.conf
ps1_update: command not found
($(cat)user@tiki:~/.vim$
以下是没有运行 tmux 的普通终端输出
user@tiki:~$ ls
backup_list.md Documents Dropbox examples.desktop hakers_and_painters.md~ hyundai Music projects ror Ubuntu One Videos windows.sh
Desktop Downloads elif.txt hakers_and_painters.md help.txt maqola.txt Pictures Public tmp update_background.sh VirtualBox VMs
user@tiki:~$ ll
total 116
-rw-rw-r-- 1 user user 380 Aug 9 17:34 backup_list.md
drwxr-xr-x 6 user user 4096 Jul 15 09:26 Desktop/
drwxr-xr-x 2 user user 4096 Jul 7 11:26 Documents/
drwxr-xr-x 11 user user 20480 Aug 20 13:53 Downloads/
-rwx------ 1 user user 729 May 7 14:45 update_background.sh*
drwxr-xr-x 2 user user 4096 Dec 10 2013 Videos/
drwxrwxr-x 4 user user 4096 Sep 10 2013 VirtualBox VMs/
-rwxrwxr-x 1 user user 36 Jan 11 2014 windows.sh*
user@tiki:~$ cd Desktop/
user@tiki:~/Desktop$ ll
total 36
-rw-rw-r-- 1 user user 3388 Jul 14 17:10 daily--report.md
-rw-rw-r-- 1 user user 71 Jan 28 2014 fernandez readme.md
-rw-rw-r-- 1 user user 23 Jan 28 2014 fernandez readme.md~
drwx------ 4 user user 4096 Mar 23 14:02 my_docs/
drwx------ 2 user user 4096 Feb 3 2014 Origami/
drwx------ 7 user user 4096 Feb 1 2013 Plants_vs._Zombies_v1.2.0.1065/
-rwxr-xr-x 1 user user 301 Apr 15 11:28 Sky Fight.desktop*
drwx------ 2 user user 4096 Feb 11 2014 webdesign/
-rwxrwxr-x 1 user user 26 Jan 11 2014 windows.sh~*
user@tiki:~/Desktop$
答案1
省略那些行
# read bashrc
source ~/.bashrc
您不能混合不同程序的配置文件(在您的情况下是 bash 和 tmux)
更新:
在您的 tmux 会话中取消设置此 bash 变量以解决“ps1_update:未找到命令”,只需运行:
$ PROMPT_COMMAND=
要将命令提示符从“($(cat)user@tiki:~$”更改为“user@tiki:~$”,我们必须将 PS1 变量设置为其默认值,只需运行:
$ PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$"
如果解决了问题,请将它们附加到您的 .bashrc