Hi On Wed, Nov 02, 2011 at 01:42:52PM +0800, stardiviner wrote: > Here is a screenshot of weird display. > you can see online link. or attachment. > http://ompldr.org/vYjM5dw/tmux.colors.png > > you will find that the background is not all same color. > and all other ncurses program has this problem. > > I setted tmux as 256colors. and set TERM > 1) TERM in .zshrc > if [ -e /usr/share/terminfo/r/rxvt-unicode-256color ]; then > export TERM="rxvt-unicode-256color" > elif [ -n "$TMUX" ]; then > export TERM=screen-256color
This is wrong, this should be the first if, or you will set the TERM in tmux to rxvt-unicode-256color on any system where it is installed. If you fix this does tmux work ok? > elif [ -e /usr/share/terminfo/x/xterm+256color ]; then > export TERM='xterm-256color' > # FIXME, does this "-e rxvt-color" for urxvt. > elif [ -e /usr/share/terminfo/r/rxvt-color ]; then > export TERM='rxvt-unicode' > else > export TERM='xterm-color' > fi > > I do not know whether other tmux options in ~/.tmux.conf will lead to this. > So I attached my ~/.tmux.conf at this mail. > > -- > stardiviner GPG: 5D9F64D8 Twitter: @numbchild > http://stardiviner.dyndns-blog.com/author.html > ############################## > # _ > # | |_ _ __ ___ _ ___ __ > # | __| '_ ` _ \| | | \ \/ / > # | |_| | | | | | |_| |> < > # \__|_| |_| |_|\__,_/_/\_\ > # > ############################# > > # get help > ## Ctrl-b ? -- list key binds. > > ## TODO startup apps. multiple windows. one session > ## TODO vim's "Esc" in tmux is a little slow. > > ## {{{2 [ tmux ] > ## set-option(set) [-agsuw] [-t target-session | target-window] option > value > ## -w : window > ## -s : server, otherwise a session option. > > ## UTF8 > setw -g utf8 on > set -g status-utf8 on > set -g mouse-utf8 on # request mouse input as UTF-8 on UTF-8 terminals. > > ## history > set -g history-limit 1000 # lines > > > ## {{{ [ title ] > set -g set-titles on > set -g set-titles-string 'tmux: #T' > ## }}} > > ## {{{ [ server ] > # set -s buffer-limit number > set -s set-clipboard on > # set -s escape-time 100 # default is 500 > # set -s quiet on # Enable or disable the display of various > informational messages > ## }}} > > ## {{{ [ session ] > set -g base-index 1 # Start counting at 1, default is 0. > ## bell > set -g bell-action any > set -g bell-on-alert on > ## default shell & command > set -g default-shell zsh > set -g default-command zsh > ## default terminal > # set -g default-terminal "screen-256color" # can not display vim italic > font. > set -g default-terminal "rxvt-256color" # can display vim italic font. > #set -g terminal-overrides > "*88col*:colors=88,*256col*:colors=256,xterm*:colors=256" > ## default working path > # set -g default-path ~/Git/projects # set default working path. > ## detach > set -g destroy-unattached off > set -g detach-on-destroy on > ## mouse > set -g mouse-resize-pane on > set -g mouse-select-pane off > set -g mouse-select-window off > ## visual > set -g visual-activity on > set -g visual-bell on > set -g visual-content on > # set -g visual-silence on > ## }}} > > ## {{{ [ window ] > ## monitor & acitvity > setw -g monitor-activity on > setw -g monitor-content on > # setw -g monitor-silence 30 > ## size > setw -g aggressive-resize on > setw -g alternate-screen on > ## rename > setw -g automatic-rename on > ## clock > setw -g clock-mode-colour blue > setw -g clock-mode-style 12 > ## Prevent tmux from resizing a window to greater than width or height. > setw -g force-height 0 # 0: unlimited > setw -g force-width 0 # 0: unlimited > # setw -g remain-on-exit on > # setw -g xterm-keys on > ## }}} > > ## {{{ [ buffer ] > # set -s buffer-limit number > ## }}} > > ## {{{ [ miscellaneous ] > ## Cc,Cr # cursor color > ## Cs,Csr # cursor style > ## }}} > > # source <path> > > ## }}} > > ## {{{2 [ ENVIRONMENT ] > ## set-environment(setenv) [-gru] [-t target-session] name [value] > ## -g global, -u unset, -r remove before starting a new process. > ## }}} > > ## {{{2 [ keybinds ] Ctrl-b (bind) > > ## bind, unbind [-cnr] key command [arguments] > ## if [-n] is specified, it is not necessary to use prefix key. > ## [-r] flag indicates the key may repeat. see the "repeat-time" option. > > ## Prefix key > # unbind C-b > # set -g prefix C-a > # bind C-a send-prefix > ## allow multiple commands to be entered without pressing the prefix-key > again. > set -g repeat-time 500 # default is 500 > ## Whether a key repeats may be set when it is bound using the -r flag to > bind-key. > ## Repeat is enabled for the default keys bound to the resize-pane > command. > > # set vi key binds > set -g status-keys vi > setw -g mode-keys vi # in man tmux, section: WINDOWS AND PANES > ## TODO > # vi-edit # when line editing at the command prompt. > # vi-choice # used in like choose-window. > # vi-copy # used in copy mode. > > ## Additional ways to move between windows include: > ## Ctrl-b l (Move to the previously selected window) > ## Ctrl-b w (List all windows / window numbers) > ## Ctrl-b <window number> (Move to the specified window number, the > default bindings are from 0 ??? 9) > ## Ctrl-b q (Show pane numbers, when the numbers show up type the key to > goto that pane) > ## Ctrl-b f <window name> (Search for window name) > > ## bind to execute a command. > # bind / neww 'exec top' > > # TODO can not use this keys > ## vim-keys.conf > # TmuxConfig=~/.tmux/ > # source ~/.tmux/vim-keys.conf > > ## similar with Function key > ## TODO bind to Ctrl-b, Ctrl-key > #bind -n F1 run-shell 'mpc toggle &>/dev/null' > #bind -n F2 run-shell 'mpc' > #bind -n F3 run-shell 'mpc prev &>/dev/null' > #bind -n F4 run-shell 'mpc next &>/dev/null' > #bind -n F11 run-shell 'mpc volume -5 &>/dev/null' > #bind -n F12 run-shell 'mpc volume +5 &>/dev/null' > > # bind-key b set-option status > # bind-key / command-prompt "split-window 'exec man %%'" > # bind-key S command-prompt "new-window -n %1 'ssh %1' > ## }}} > > ## {{{2 [ layout ] windows, pane, status line, names > bind F12 source ~/.tmux.conf # reload tmux config > > set -g display-time 4000 > # set -g lock-after-time 1800 > > ## {{{ [ pane ] > set -g display-panes-time 4000 > set -g display-panes-colour default > set -g display-panes-active-colour red > set -g pane-border-fg red > set -g pane-border-bg default > set -g pane-active-border-fg red > set -g pane-active-border-bg default > setw -g other-pane-height 40 > setw -g other-pane-width 50 > setw -g synchronize-panes off > ## }}} > > ## {{{ [ layout mode ] > # setw mode-attr bold > # setw mode-fg blue > # setw mode-bg black > # setw mode-mouse on > # select-layout main-vertical # FIXME > setw -g main-pane-height 50 > setw -g main-pane-width 81 > ## }}} > > ## Don't close windows > # set -g set-remain-on-exit on > > ## }}} > > ## {{{2 [ status line ] > ## attr: bold, bright, underscore, dim, blink, reverse, hidden or italics. > ## color: black, red, green, yellow, blue, magenta, cyan, white, > ## color0 to color255 from the 256-colour set. > ## default, or a hexadecimal RGB string such as ???#ffffff???. > > ## {{{ [ status ] > set -g status on > set -g status-bg black # value can be "default" > set -g status-fg default > set -g status-attr bold > set -g status-justify centre # position of the window list component of > the status line. > set -g status-interval 5 > set -g status-left-length 50 > set -g status-right-length 50 > # set -g status-right "" > # set -g status-left "" > # TODO add username before @ > set -g status-left '#[fg=red,bold] ??? #[fg=red]{#[fg=white]@#H#[fg=red]} > #[fg=cyan]#([ -n "`mpc status|grep playing`" ] && echo "???") > #[fg=green,bold]?? ' > # here date,time: reference command "date" > # #[fg=blue,bold]#(echo "???/???") #[fg=cyan]fuck #[fg=red,bold]??? > # TODO add loadavg > set -g status-right '{#P:#S} #[fg=white,dim]#(uptime|cut -d"," > -f3,4,5|cut -d ":" -f2) #[fg=red][#[fg=green,bold]%l:%M %p #[fg=magenta]%a > %m-%d#[fg=red] ] #[fg=red,bold]??? ' > ## }}} > > ## {{{ [ window status ] > setw -g window-status-fg white > setw -g window-status-bg black > setw -g window-status-format "#[fg=white]#I.#W#F #[default]" > setw -g window-status-alert-fg red > setw -g window-status-alert-bg black > setw -g window-status-alert-attr bright > setw -g window-status-current-fg blue > setw -g window-status-current-bg black > setw -g window-status-current-attr bold > setw -g window-status-current-format "#[fg=bold,reverse]#I.#W#F > #[default]" > # #F: flag symbol > # Symbol Meaning > # * Denotes the current window. > # - Marks the last window (previously selected). > # # Window is monitored and activity has been detected. > # ! A bell has occurred in the window. > # + Window is monitored for content and it has appeared. > # ~ The window has been silent for the monitor-silence > interval. > # setw -g word-separators ' -_@' > ## }}} > > ## {{{ [ message ] > set -g message-attr italics > set -g message-fg white > set -g message-bg black > set -g message-limit 50 # default is 20 > ## }}} > > ## {{{ [ prompt ] > ## command-prompt [-I inputs] [-p prompts] [-t target-client] [template] > ## confirm-before [-p prompt] [-t target-client] command > ## display-message [-p] [-c target-client] [-t target-pane] [message] > ## }}} > > ## }}} > > ## {{{2 [ session ] initialization, detached & reattached > ## Note: Numbering for sessions, windows and panes starts at zero, unless > you have specified a > ## base-index of 1 in your .conf > ## You can have tmux open a session with preloaded windows by including > those details > ## [ syntax ] > ## new-session(new) [-d] [-n window-name] [-s session-name] [-t > target-session] [-x width] [-y height] > ## [shell-command] > # TODO > ## XXX run command: $ tmux attach to get this session. > # new -s Daily -n Mutt mutt # FIXME add vimPlan at here > # neww > # neww -n Plan vimPlan > # neww -n mutt mutt > # neww -n IRC nm-online && weechat-curses > # neww -n Ranger 'ranger /media/tux/data' > # neww -n music ncmpcpp > # neww -n sound alsamixer > # neww -n vimwiki vimwiki > # neww -n RSS newsbeuter > # neww -n news nm-online && slrn > # neww -n podcasts podbeuter > # attach -t Daily > # clock-mode -t Daily:2 # target-pane > # select-window -t Daily:1 > > ## To start a session with split windows (multiple panes), include the > splitw command below the > ## neww you would like to split; thus: > #new -s SessionName -n WindowName Command > #neww -n foo/bar foo > #splitw -v -p 50 -t 0 bar > #selectw -t 1 > #selectp -t 0 > ## would open 2 windows, the second of which would be named foo/bar and > would be split vertically > ## in half (50%) with foo running above bar. Focus would be in window 2 > (foo/bar), top pane (foo). > > ## To manage multiple sessions, source separate session files from your > conf file: > ## initialize sessions > # bind F source ~/.tmux/foo > # bind B source ~/.tmux/bar > > # First session. > #new -d -s0 -nirssi 'exec ssh -t natalya exec sh ~/bin/tmux-start' > #setw -t0:0 monitor-activity on > #setw -t0:0 aggressive-resize on > #set -t0 status-bg green > #neww -d -ntodo 'exec emacs ~/TODO' > #setw -t0:1 aggressive-resize on > #neww -d -ntodo2 'exec emacs ~/TODO2' > #setw -t0:2 aggressive-resize on > #neww -d -nncmpc 'exec ncmpc -f ~/.ncmpc.conf' > #setw -t0:3 aggressive-resize on > #neww -d -nmutt 'exec mutt' > #setw -t0:4 aggressive-resize on > ## Second session. > #new -d -s1 > #set -t1 status-bg cyan > #linkw -dk -t0 -s0:0 > #linkw -dk -t1 -s0:1 > #linkw -dk -t2 -s0:2 > #linkw -dk -t3 -s0:3 > #linkw -dk -t4 -s0:4 > ## }}} > > ## {{{2 [ Tips & Tricks ] > ## browsing URL's > ## To browse URL's inside tmux you must have urlview installed and > configured: > bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell > "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'" > > ## CLIPBOARD selection integration > ## Requires prefix key before the command key > ## Copy tmux paste buffer to CLIPBOARD > # bind C-c run "tmux show-buffer | xclip -i -selection clipboard" > ## Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer > # bind C-v run "tmux set-buffer \"$(xclip -o -selection clipboard)\"; > tmux paste-buffer" > ## }}} > > ## {{{2 [ FAQ ] > ## http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ > ## tmux freezes my terminal when I attach to a session > ## Some consoles really really don't like attempts to set the window > title. > # set -g set-titles off > > ## Why is C-b the prefix key? How do I change it? > ## The default key is C-b because the prototype of tmux was originally > developed > ## inside screen and C-b was chosen not to clash with the screen meta > key. > # set -g prefix C-a > # unbind C-b > # bind C-a send-prefix > > ## How do I use UTF-8? > ## When running tmux in a UTF-8 capable terminal, UTF-8 must be turned on > in tmux; > ## as of release 0.9, tmux attempts to autodetect a UTF-8-capable > terminal by > ## checking the LC_ALL, LC_CTYPE and LANG environment variables. > # $ tmux -u new > ## Since the 1.0 release, tmux will turn on UTF-8 related options > automatically > ## (ie status-utf8, and utf8) if the above conditions are met. > > ## How do I use a 256 colour terminal? > ## Provided the underlying terminal supports 256 colours, it is usually > sufficient > ## to add the following to ~/.tmux.conf: > # set -g default-terminal "screen-256color" > ## Note that some platforms do not support "screen-256color" ("infocmp > ## screen-256color" will return an error) - in this case see the next > entry in > ## this FAQ. > > ## vim or $otherprogram doesn't display 256 colours. What's up? > > ## How do I make Ctrl-PgUp and Ctrl-PgDn work in vim? > ## tmux supports passing through ctrl (and where supported by the client > terminal, > ## alt and shift) modifiers to function keys using xterm(1)-style key > sequences. > ## This may be enabled per window, or globally with the tmux command: > # setw -g xterm-keys on > ## Because the TERM variable inside tmux must be set to "screen", vim > will not > ## automatically detect these keys are available; however, the > appropriate key > ## sequences can be overridden in .vimrc using the following: > # if &term == "screen" > # set t_kN=^[[6;*~ > # set t_kP=^[[5;*~ > # endif > ## And similarly for any other keys for which modifiers are desired. > ## Please note that the "xterm-keys" setting may affect other programs, > in the > ## same way as running them in a standard xterm; > ## vim users may also want to set the "ttyfast" option inside tmux. > > ## What is the proper way to escape characters with #(command)? > > ## tmux uses too much CPU. What do I do? > ## Automatic window renaming may use a lot of CPU, particularly on slow > computers: > ## if this is a problem, turn it off with "setw -g automatic-rename off". > > ## What is the best way to display the load average? Why no #L? > # uptime|awk '{split(substr($0, index($0, "load")), a, ":"); print a[2]}' > > ## How do I attach the same session to multiple clients but with a > different > ## current window, like screen -x? > ## One or more of the windows can be linked into multiple sessions > manually with > ## link-window, or a grouped session with all the windows can be created > with > ## new-session -t. > > ## How can I blank the tmux window? > ## GNU screen has a feature whereby it will blank the screen after a > period of > ## inactivity. To do the same thing in tmux, use the lock-command > setting, for > ## example (with GNU bash): > # set -g lock-command 'tput civis && read -s -n1' > ## This will remove the cursor and tell the shell to quit once a key has > been > ## pressed. For zsh, use "read -s -k1". > ## In addition, it's possible to have both blanking and locking (for > instance via > ## lock(1) or vlock(1)) by using the following: > # bind x set lock-command '/usr/bin/vlock' \; lock-client \; set > lock-command 'tput civis && read -s -n1' > > ## How can I open a new window in the same directory as the current > window? > > ## tmux doesn't start with "daemon failed" > > ## vim displays reverse video instead of italics, while less displays > italics > ## (or just regular text) instead of reverse. What's wrong? > # if [ -n "$TMUX" ]; then > # export TERM=screen-256color > ## }}} > > ## {{{ [ options ] > ## -t : target-client, target-session, target-window, target-pane. > ## XXX if-shell(if) shell-command command > ## XXX run-shell(run) shell-command > ## }}} > > > # vim:ft=tmux:fdm=marker > ------------------------------------------------------------------------------ > RSA® Conference 2012 > Save $700 by Nov 18 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users