My tmux config is almost totally how I want it, but for some reason my status left background keeps getting turned red/green after running for some time. I'd really like to get rid of this if possible.
Here's an image of what happens:
Here's a subset of my .tmux.conf that would be relevant. colour226 is my yellow and colour16 is my black:
# colors
set -g status-fg colour226
set -g status-bg colour16
set -g pane-active-border-fg colour226
set -g pane-active-border-bg colour226
set -g message-fg colour226
set -g message-bg colour16
set -g message-attr bright
# status bar
set -g window-status-current-bg colour226
set -g window-status-current-fg colour16
set -g window-status-current-attr bright
set -g window-status-current-format "#I:#W"
set -g window-status-format "#I:#W"
set -g window-status-style fg=green
set -g status-left-length 40
set -g status-left-style bg=colour16
set -g status-left "[#W]"
set -g status-left-attr bright
set -g status-right "%d %b %R"
set -g status-interval 60
set -g status-justify centre
setw -g monitor-activity on
You can see that I've tried forcing the status-left background to be black, but I think the activity monitor is causing it to show there.
I've been looking through the man page, but haven't found anything. Any ideas of how I might be able to disable the highlight?
As you said, it is the "monitor-activity" that does that. Why don't you just set that off ? (that's what I do, for the same reason)
Related
Whenever I open tmux for the first time, it throws the following error.
/home/user/.tmux.conf:67: no current window
The relevant parts of the conf file are as follows.
52 set-window-option -g window-status-fg "#666666"
53 set-window-option -g window-status-bg default
54 set-window-option -g window-status-attr default
55 set-window-option -g window-status-current-fg red
56 set-window-option -g window-status-current-bg default
57 set-window-option -g window-status-current-attr default
58 set-option -g message-fg white
59 set-option -g message-bg black
60 set-option -g message-attr bright
61 set -g status-left " "
62 set -g status-justify left
63 setw -g window-status-format ' #(echo "[#{window_index}]#{window_name}") '
64 #setw -g window-status-current-format ' #(echo "[#{window_index}]#{window_name}") '
65 setw -g window-status-current-format ' #(echo "#{window_name}") '
66 set -g status-right "#(echo $(date))"
67 set allow-rename off
68 set -sg escape-time 0
This error appears only for the first session I open, for subsequent sessions, the error does not appear.
You don't have -g on that set command so it needs a window to set the option on, but no windows exist yet.
Any idea what might be causing this error below ?
Google was no help.
Everything is just fine if I am not in tmux.
Tmux version is 1.9a.
>pwd
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
-bash: 7: Bad file descriptor
>ls
-bash: 7: Bad file descriptor
>pwd
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
-bash: 7: Bad file descriptor
>cd
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
-bash: 7: Bad file descriptor
>pwd
/home/joco
-bash: 7: Bad file descriptor
>ls
My tmux conf is:
>cat ~/.tmux.conf
set -g prefix C-b
set -sg escape-time 1
set -g base-index 1
set -g pane-base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind \ split-window -h
bind - split-window -v
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
set-option -g repeat-time 400
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
set -g xterm-keys on
set -g default-terminal "xterm-256color"
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
set -g mode-mouse on
setw -g mode-keys vi
bind e display "#{pane_current_path}"
set -g display-panes-time 2000
set-option -g display-time 4000
#bind-key -tvi-copy y copy-pipe "~/bin/pbcopy"
#set -g default-terminal "screen-256color"
bind -t vi-copy y copy-pipe 'pbcopy-remote'
bind C-c run "tmux save-buffer - | pbcopy-remote"
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
set-window-option -g xterm-keys on
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
set-window-option -g xterm-keys on
set -g status-right "#(date)"
# List of plugins
#set -g #plugin 'tmux-plugins/tpm'
#set -g #plugin 'tmux-plugins/tmux-sensible'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set -g #plugin 'seebi/tmux-colors-solarized'
set -g #colors-solarized 'light'
#set -g #colors-solarized '256'
#set -g #colors-solarized 'dark'
EDIT:
After starting a new tmux (as recommended by Robert), I get:
.bash_profile is called
-bash: 7: Bad file descriptor
>pwd
/home/joco
-bash: 7: Bad file descriptor
>pwd
/home/joco
-bash: 7: Bad file descriptor
>cd
-bash: 7: Bad file descriptor
>
I had the same problem with GNU screen: -bash: 7: Bad file descriptor.
The problem was that I had started screen from a subshell of Midnight Commander. Exiting Midnight Commander before starting screen fixed it.
I begin to use tmux ,and it's great ,but when I split a window,the default hjkl is vim-like pane switch,so why? how to input hjkl?
here is my config
unbind C-b
set -g prefix C-q
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0
setw -g monitor-activity on
set -g visual-activity on
set-option -g mouse-select-pane on
#-- bindkeys --#
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
unbind '"'
bind-key - splitw -v
unbind %
bind-key | split-window -h
#-- statusbar --#
set -g status-justify centre
set -g status-left "#[fg=green]#S:w#I.p#P#[default]"
set -g status-left-attr bright
set -g status-left-length 20
set -g status-right "#[fg=green]#(/usr/bin/uptime)#[default] • #[fg=green]#(cut -d ' ' -f 1-3 /proc/loadavg)#[default]"
set -g status-right-attr bright
set -g status-utf8 on
set -g status-interval 1
setw -g automatic-rename off
#set -g status-bg black
#set -g status-fg yellow
#setw -g window-status-current-attr bright
#setw -g window-status-current-bg red
#setw -g window-status-current-fg white
#-- colorscheme --#
#-- see also: https://github.com/seebi/tmux-colors-solarized --#
# default statusbar colors
set -g status-bg colour235 #base02
set -g status-fg colour136 #yellow
set -g status-attr default
# default window title colors
setw -g window-status-fg colour244
setw -g window-status-bg default
#setw -g window-status-attr dim
# active window title colors
setw -g window-status-current-fg colour166 #orange
setw -g window-status-current-bg default
#setw -g window-status-current-attr bright
# pane border
set -g pane-border-fg colour235 #base02
set -g pane-active-border-fg colour240 #base01
# message text
set -g message-bg colour235 #base02
set -g message-fg colour166 #orange
# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange
# clock
setw -g clock-mode-colour colour64 #green
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
enables pane switching with h, j and so on, if you meant this =)
On Mac Mountain lion, tmux installed via Homebrew.
Some settings like the following doesn't work:
setw -g pane-base-index 1
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
Then error:
/Users/millisami/.tmux.conf: 52: unknown option: pane-base-index
/Users/millisami/.tmux.conf: 53: unknown option: mouse-resize-pane
/Users/millisami/.tmux.conf: 55: unknown option: mouse-select-window
Whats wrong?
As rado said, tmux 2.1 doesn't support the individual mouse settings. It replaced them with a single setting, mouse which can be set with set -g mouse on in your ~/.tmux.conf.
As for the pane-base-index setting, Mark Nichols suggestion of:
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
worked for me on OS X 10.10.5 running tmux 2.1 installed via brew in iTerm 2.1.4.
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
It could be that you are using tmux 2.1, which doesn't support those anymore.
from what I understand
set -g mouse-select-window on
Should allow me to click on a window in the status bar and go to that window. I put that in my tmux.conf file though and nothing happens when I click on a window. What am I doing wrong?
In my .tmux.conf I have the following:
set -g mode-mouse on
set -g mouse-select-window on
set -g mouse-select-pane on
Do you have the mode-mouse on setting?
On 2.1 this config got deprecated and the new option to allow all mouse support is:
set -g mouse on
This break the nice mouse scroll support, but can be enabled with this:
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"