From 9da18ed22b25eaffe868fd6e68a60035bcdf3063 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 19 Dec 2011 11:49:57 +0000 Subject: [PATCH 01/16] Allow X multiplier for usize. Use X3 to use the same multiplier for both width and height. --- opt/bin/usize | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opt/bin/usize b/opt/bin/usize index c287fa1..e965db3 100755 --- a/opt/bin/usize +++ b/opt/bin/usize @@ -4,6 +4,7 @@ # size. # Usage: usize [] # Usage: usize x [x] +# Usage: usize X # width=${COLUMNS:-80} @@ -20,12 +21,16 @@ case $# in esac # Allow, eg, x2 for width or height. -if [ ! "${width#x}" = "${width}" ]; then +if [ ! "${width#X}" = "$width" ]; then + width="${width/X/x}" + height=$width +fi +if [ ! "${width#x}" = "$width" ]; then # Add a column for dividers. width=${width#x} width=$((width-1+(87*width))) fi -if [ ! "${height#x}" = "${height}" ]; then +if [ ! "${height#x}" = "$height" ]; then height=${height#x} height=$((24*height)) # Add a row for tmux. -- 2.20.1 From 35a3cbb0c868c98f17cd0352e96414c3347760be Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 5 Sep 2011 16:11:00 +0100 Subject: [PATCH 02/16] Defeat various key repeating niggles. Don't allow key repeating for unshifted keys and arrows. Switch to pane left with ^p l. Start typing ls. Find yourself two panes left. But allow control-alt-h/j/k/l to resize windows with repeats. Using alt on its own doesn't work because terminal funkiness will lead tmux to think, for example, alt-k was pressed if ^p^k is quickly followed by escape then ^k. This can (and does) happen when switching to a pane and immediately recalling the previous history entry. --- .tmux.conf | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 9b915df..dcd460b 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -46,17 +46,22 @@ bind > command-prompt -p "Save buffer to file:" 'save-buffer %1' ################################################################################ # Up and down like Vim. bind j select-pane -D -bind C-j select-pane -D +bind -r C-j select-pane -D bind k select-pane -U -bind C-k select-pane -U +bind -r C-k select-pane -U +# Don't let arrow keys repeat. +bind Up select-pane -U +bind Down select-pane -D +bind Left select-pane -L +bind Right select-pane -R # Previous and next panes kinda like Vim. bind h select-pane -L -bind C-h select-pane -L +bind -r C-h select-pane -L bind l select-pane -R -bind C-l select-pane -R +bind -r C-l select-pane -R # And for windows. -bind H previous-window -bind L next-window +bind -r H previous-window +bind -r L next-window # Last window like Vim. bind ^ last-window bind C-^ last-pane @@ -65,8 +70,8 @@ bind J select-pane -D bind K select-pane -U # Swap panes. bind o swap-pane -D -bind C-o swap-pane -D -bind O swap-pane -U +bind -r C-o swap-pane -D +bind -r O swap-pane -U bind w command-prompt -p "Select [.] to swap:" 'swap-pane -s . -t %1' # Swap windows. bind W choose-window "swap-window -t '%%'" @@ -80,11 +85,17 @@ bind B command-prompt -p "Select [.] to join:" 'join-pane -s %1' bind C-\ split-window -v # Next pane. bind i select-pane -t :.+ -bind C-i select-pane -t :.+ -bind I select-pane -t :.- +bind -r C-i select-pane -t :.+ +bind -r I select-pane -t :.- +# Resize pane. +bind -r C-M-h resize-pane -L +bind -r C-M-j resize-pane -D +bind -r C-M-k resize-pane -U +bind -r C-M-l resize-pane -R # Layouts. bind . select-layout even-vertical bind , select-layout tiled +bind -r Space next-layout # Simulate maximising the window. bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999 # Select windows. @@ -116,7 +127,7 @@ bind { copy-mode -u # XXX: As of tmux 1.3 this doesn't work. #bind '"' choose-buffer 'show-buffer -b %%' bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1' -bind "'" show-buffer +bind "'" new-window -n "[buffer]" "cat > /dev/null" \; paste-buffer # Toggle mouse mode as it is useful despite the flaws listed above. bind C-m set -g mouse-resize-pane \; set -g mouse-select-pane \; set -g mouse-select-window \; set -g mode-mouse -- 2.20.1 From 048f167991e3e1c7c2e7f053fa7854ac803f48b8 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 19 Oct 2011 11:01:53 +0100 Subject: [PATCH 03/16] Change layout keys. Various changes to which keys select which layout. --- .tmux.conf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index dcd460b..e383a37 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -93,11 +93,16 @@ bind -r C-M-j resize-pane -D bind -r C-M-k resize-pane -U bind -r C-M-l resize-pane -R # Layouts. -bind . select-layout even-vertical -bind , select-layout tiled -bind -r Space next-layout +bind , select-layout even-vertical +bind . select-layout even-horizontal +bind / select-layout tiled +bind M-, select-layout main-vertical +bind M-. select-layout main-horizontal +bind Space next-layout +bind -r C-Space next-layout # Simulate maximising the window. -bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999 +bind / select-layout main-horizontal \; resize-pane -D 9999 +bind M-/ select-layout tiled # Select windows. bind - choose-window bind M-0 select-window -t 10 -- 2.20.1 From 40bb8565e90e541eb6eeae62d12b2f8f82d56883 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 20 Jan 2012 11:23:28 +0000 Subject: [PATCH 04/16] Allow specifying path to tmux socket. Use -S to pass the socket path flag to tmux. --- opt/bin/ktmux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opt/bin/ktmux b/opt/bin/ktmux index 9545c36..9989842 100755 --- a/opt/bin/ktmux +++ b/opt/bin/ktmux @@ -5,6 +5,7 @@ # Options: -I Pass path to kinit through to ktmux_helper. # -L Pass path to klist through to ktmux_helper. # -R Pass path to krenew through to ktmux_helper. +# -S Socket path for tmux. # -T Path to tmux. # -n Window name for new tmux session. # -s Session name for new tmux session. @@ -15,11 +16,12 @@ tmux=tmux helper_opts= tmux_opts= session_opts= -while getopts ":I:L:R:T:n:s:t:" opt; do +while getopts ":I:L:R:S:T:n:s:t:" opt; do case $opt in I|L|R) helper_opts="$helper_opts -$opt $OPTARG";; T) tmux="$OPTARG"; helper_opts="$helper_opts -$opt $OPTARG";; n|s|t) session_opts="$session_opts -$opt $OPTARG";; + S) tmux_opts="$tmux_opts -$opt $OPTARG";; esac done shift $((OPTIND-1)) -- 2.20.1 From c396d112edafe6f3044fe08f6abe147596abbc68 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 8 Dec 2011 13:19:55 +0000 Subject: [PATCH 05/16] Highlight unwanted whitespace. Use a slightly modified version of the script from http://vim.wikia.com/wiki/Highlight_unwanted_spaces to flag whitespace at the end of a line. --- .vimrc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.vimrc b/.vimrc index 52bacca..45d56e3 100644 --- a/.vimrc +++ b/.vimrc @@ -991,6 +991,7 @@ fun! Cycle_List() "{{{2 endif call Resize_Columns(Extra_Columns("list", "iainlist", " == 2"), 1) + call Extra_Whitespace_Match() endfun "}}}2 " Cycle between hex and decimal display of toolbar stuff. @@ -1027,6 +1028,11 @@ fun! Cycle_Alt() "{{{2 call Show_StatusLine() endfun "{{{2 +" To be overridden later if applicable. +fun! Extra_Whitespace_Match() "{{{2 + " NOP. +endfun "}}}2 + " Swap hex/decimal statusline with \x. call Mapping("x", ":call Cycle_HexStatusLine():") " Change statusline verbosity with \v. @@ -1244,6 +1250,55 @@ let g:bufExplorerSplitOutPathName=0 let g:NERDSpaceDelims=1 endif "}}}1 +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Handle options only available in Vim 7.2 and above. +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +if version >= "702" "{{{1 +if has("autocmd") + " http://vim.wikia.com/wiki/Highlight_unwanted_spaces + augroup WhitespaceMatch + autocmd! + au Display BufWinEnter * call Extra_Whitespace_Match() + au Display Syntax * call Extra_Whitespace_Match() + au Display BufWinLeave * call clearmatches() + augroup END + + fun! Extra_Whitespace_Match() "{{{2 + " \s\+ + " $ + " \@ + " \%# + let l:pattern = '\s\+\%#\@ + " \(^\s$\) + let l:pattern = '\(^\s$\)\@!' . l:pattern + endif + + let l:hl = 'ctermfg=red guifg=red' + if ! &list + " Underline if we aren't using listchars. + let l:hl = l:hl . ' cterm=underline gui=underline' + endif + highlight clear ExtraWhitespace + exe "highlight ExtraWhitespace " . l:hl + if exists('w:whitespace_match_number') + try + call matchdelete(w:whitespace_match_number) + catch + endtry + call matchadd('ExtraWhitespace', l:pattern, 10, w:whitespace_match_number) + else + let w:whitespace_match_number = matchadd('ExtraWhitespace', l:pattern) + endif + endfun "}}}2 + + call Extra_Whitespace_Match() +endif + +endif "}}}1 + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Handle options only available in Vim 7.3 and above. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- 2.20.1 From 49a954bd748f27f80c92fd0843ed9e0029d53709 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 20 Jan 2012 11:50:34 +0000 Subject: [PATCH 06/16] Reuse windows when using sbuffer. --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 45d56e3..ce3b0ca 100644 --- a/.vimrc +++ b/.vimrc @@ -614,6 +614,9 @@ endif "}}}1 if version >= "504" "{{{1 version 5.4 +" Reuse windows when using sbuffer. +se switchbuf=useopen + " Do we have Unicode? fun! Has_Unicode() "{{{2 if ! has('multi_byte') -- 2.20.1 From a8f817805f18dcdd95129a654d209883ab7758f8 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 20 Jan 2012 11:44:41 +0000 Subject: [PATCH 07/16] Whitespace. --- .vimrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.vimrc b/.vimrc index ce3b0ca..3d83fbd 100644 --- a/.vimrc +++ b/.vimrc @@ -2,16 +2,16 @@ " Multi-version vimrc compatible with version 4 and above. vim:set fdm=marker: """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Note that "if | call Something() | endif" syntax is unsupported -" in Vim 4 so we write all our functions out the long way. It does work in +" Note that "if | call Something() | endif" syntax is unsupported +" in Vim 4 so we write all our functions out the long way. It does work in " autocommand definitions, however. " Vim 4 complains if version isn't set in the configuration file. version 4.0 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Handle options safe to use in version 4. Vim 4 parses but ignores the -" "if version" syntax used later in this file so we don't use it. No attempt +" Handle options safe to use in version 4. Vim 4 parses but ignores the +" "if version" syntax used later in this file so we don't use it. No attempt " is made to make this configuration compatible with Vim 3. " Some of these settings should strictly be wrapped inside "if has()" blocks " but that would cause them not to be ignored by Vim 4. @@ -320,7 +320,7 @@ endfun "}}}2 " Set extra columns depending on window status. fun! Extra_Columns(extra, var, ...) "{{{2 " Vim 6 doesn't have winnr("$"). Determine which windows are open - " ourselves by using :windo to incremement a counter. As Vim 5 + " ourselves by using :windo to incremement a counter. As Vim 5 " doesn't have :windo we require Vim 6 for this. if v:version < "600" return "" @@ -1234,7 +1234,7 @@ map gb :tabprevious: " Transparency. if has("gui_macvim") se transparency=15 -endif +endif " Yet more GUI options. Add tabs. if has("gui") -- 2.20.1 From 0b4f8e336ddf05f77b2bb6b6eec9e82e4f5d6569 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 20 Jan 2012 11:32:29 +0000 Subject: [PATCH 08/16] Use ^w-^ to switch to the last used window. For consistency with tmux, which uses ^ to switch to the last pane, which is in itself for consistency with vim using ^ to switch to the last buffer. Default vim action would be to split and edit the last buffer. That's sometimes useful but overall less useful than switching windows. --- .vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vimrc b/.vimrc index 3d83fbd..28d060e 100644 --- a/.vimrc +++ b/.vimrc @@ -75,6 +75,10 @@ inoremap " Swap jump keys. noremap ' ` noremap ` ' + +" Select previous widnow. +noremap ^ p +noremap p "}}}1 " Find stuff. -- 2.20.1 From a35f8d97f6761f915b2e8395e1894785015799c0 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 24 Feb 2012 13:55:56 +0000 Subject: [PATCH 09/16] Support tmux 1.6. --- .tmux.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index e383a37..991bc49 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -166,6 +166,8 @@ set -g display-panes-colour colour17 # Command entry. set -g message-bg colour90 set -g message-fg white +set -g message-command-bg colour88 +set -g message-command-fg white # Active pane set -g pane-active-border-bg default set -g pane-active-border-fg white @@ -178,6 +180,14 @@ setw -g mode-fg white # Monitored windows (in reverse video). setw -g window-status-alert-bg red setw -g window-status-alert-fg white +# As of tmux 1.6 we can highlight different alerts. +setw -g window-status-bell-bg colour22 +setw -g window-status-bell-fg white +setw -g window-status-content-bg colour88 +setw -g window-status-content-fg white +setw -g window-status-content-attr none +setw -g window-status-activity-bg red +setw -g window-status-activity-fg white ################################################################################ # Caption settings. -- 2.20.1 From 023ace4cee5028e65f80867e2181dc801145783a Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Tue, 28 Feb 2012 15:16:35 +0000 Subject: [PATCH 10/16] Use alt-underscore to monitor a pane for silence. --- .tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.tmux.conf b/.tmux.conf index 991bc49..8e27609 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -37,6 +37,7 @@ bind C-[ copy-mode bind ] paste-buffer bind C-] paste-buffer bind _ setw monitor-activity +bind M-_ setw monitor-silence 10 bind * list-clients bind < command-prompt -p "Load buffer from file:" 'load-buffer %1' bind > command-prompt -p "Save buffer to file:" 'save-buffer %1' -- 2.20.1 From 170f7f08b60305eef1a6518e440e6b49ce6a4bab Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 1 Mar 2012 12:46:45 +0000 Subject: [PATCH 11/16] Use ^o to switch back to the last pane. Switching back and forth between panes is done often enough to justify an easier way than reaching for the six key. --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 8e27609..f518897 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -66,12 +66,12 @@ bind -r L next-window # Last window like Vim. bind ^ last-window bind C-^ last-pane +bind C-o last-pane # Top and bottom. bind J select-pane -D bind K select-pane -U # Swap panes. bind o swap-pane -D -bind -r C-o swap-pane -D bind -r O swap-pane -U bind w command-prompt -p "Select [.] to swap:" 'swap-pane -s . -t %1' # Swap windows. -- 2.20.1 From 10c940961d293df41967a09e5a8c326beaa94afd Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 3 May 2012 15:08:55 +0100 Subject: [PATCH 12/16] Use bash builtin to check for tty. --- .profile.d/krb5.bashrc | 2 +- .profile.d/ssh.bashrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile.d/krb5.bashrc b/.profile.d/krb5.bashrc index 034dadd..4c5f71d 100644 --- a/.profile.d/krb5.bashrc +++ b/.profile.d/krb5.bashrc @@ -3,7 +3,7 @@ alias pssh='ssh -o preferredauthentications=password,keyboard-interactive' unalias kinit 2>/dev/null if [ 1 = 0 -a -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then - if tty -s; then + if [ -t 0 ]; then if [ ! "$SUDO_UID" ]; then if klist -s 2>/dev/null; then # We already have a ticket cache. Renew it. diff --git a/.profile.d/ssh.bashrc b/.profile.d/ssh.bashrc index 0bb5011..65d117d 100644 --- a/.profile.d/ssh.bashrc +++ b/.profile.d/ssh.bashrc @@ -6,7 +6,7 @@ if [ $UID -gt 0 ]; then while read allowed; do if [ "${HOSTNAME%%.*}" = "$allowed" ]; then eval $(keychain -q --timeout 7200 --agents ssh --eval) - if tty -s; then + if [ -t 0 ]; then ssh-add -l >/dev/null || ssh-add fi fi -- 2.20.1 From fc8569b09fbdd15940d09c154e6d7795c5e10294 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 3 May 2012 15:12:07 +0100 Subject: [PATCH 13/16] Fix corruption in fonts.conf and prefer DejaVu fonts. --- .fonts.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.fonts.conf b/.fonts.conf index 7c71610..3ef40d6 100644 --- a/.fonts.conf +++ b/.fonts.conf @@ -452,6 +452,7 @@ sans-serif + DejaVu Sans Arial Meiryo Arabic Typesetting @@ -486,6 +487,7 @@ monospace + DejaVu Sans Mono Consolas Inconsolata Andale Mono @@ -1977,8 +1979,7 @@ - + Aquabase Browallia New BrowalliaUPC -- 2.20.1 From 92c2a08e6ae4088fc8bf00c8f3f0183eabe87481 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 14 Sep 2012 15:53:17 +0100 Subject: [PATCH 14/16] Support urxvt with a 32-bit RGBA visual. Use a semi-transparent background for urxvt where possible. For it to work we need a compositing manager running on a display with support for at least one 32-bit visual and a window manager which respects the depth, visual and colormap supplied by urvxt. --- .Xdefaults | 4 +++- .ssh/colours/cambridge.iain.cx$ | 2 +- .ssh/colours/furryclan.net$ | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.Xdefaults b/.Xdefaults index 1869fa3..227f66e 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -27,7 +27,9 @@ Dtterm*dtTermView.marginWidth: 0 ! transparency !rxvt.inheritPixmap: True urxvt.foreground: white -urxvt.background: black +urxvt.background: [70]black +urxvt.highlightColor: [90]#8080ff +urxvt.depth: 32 urxvt.borderColor: black urxvt.scrollBar_right: True urxvt.font: xft:DejaVu Sans Mono:pixelsize=12,xft:AR PL Uming HK diff --git a/.ssh/colours/cambridge.iain.cx$ b/.ssh/colours/cambridge.iain.cx$ index d3c3d42..dc78824 120000 --- a/.ssh/colours/cambridge.iain.cx$ +++ b/.ssh/colours/cambridge.iain.cx$ @@ -1 +1 @@ -DarkRed:#400000 \ No newline at end of file +DarkRed:[70]#400000 \ No newline at end of file diff --git a/.ssh/colours/furryclan.net$ b/.ssh/colours/furryclan.net$ index e19361a..ef2e02a 120000 --- a/.ssh/colours/furryclan.net$ +++ b/.ssh/colours/furryclan.net$ @@ -1 +1 @@ -DarkBrown:#804000 \ No newline at end of file +DarkBrown:[70]#804000 \ No newline at end of file -- 2.20.1 From c41c10ea12b1d5214b7730d3c08a21808619574a Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 14 Sep 2012 15:58:22 +0100 Subject: [PATCH 15/16] SSHTERM background for ads.iain.cx. --- .ssh/colours/ads.iain.cx$ | 1 + 1 file changed, 1 insertion(+) create mode 120000 .ssh/colours/ads.iain.cx$ diff --git a/.ssh/colours/ads.iain.cx$ b/.ssh/colours/ads.iain.cx$ new file mode 120000 index 0000000..dc78824 --- /dev/null +++ b/.ssh/colours/ads.iain.cx$ @@ -0,0 +1 @@ +DarkRed:[70]#400000 \ No newline at end of file -- 2.20.1 From 6c50c01c0cb5486964d139dd4f12b15464d984ec Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 14 Sep 2012 15:58:41 +0100 Subject: [PATCH 16/16] Script to set urxvt background colour on the fly. --- opt/bin/ucolour | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 opt/bin/ucolour diff --git a/opt/bin/ucolour b/opt/bin/ucolour new file mode 100755 index 0000000..796afda --- /dev/null +++ b/opt/bin/ucolour @@ -0,0 +1,51 @@ +#!/bin/bash +# +# ucolour: Set urxvt (or terminal which understands the same escape sequences) +# colours. +# Usage: ucolour option [option ...] +# Options: -b Set background. +# -B Set highlight background. +# -c Set cursor. +# -f Set foreground. +# -F Set highlight foreground. +# -m Set mouse. +# + +BG= +FG= +bg= +fg= +cu= +mo= +tmux_prefix= +while getopts ":B:F:b:c:f:m:" opt; do + case $opt in + B) BG=$OPTARG;; + F) FG=$OPTARG;; + b) bg=$OPTARG;; + c) cu=$OPTARG;; + f) fg=$OPTARG;; + m) mo=$OPTARG;; + esac +done +shift $((OPTIND-1)) + +if [ -z "$BG$FG$bg$cu$fg$mo" ]; then + echo >&2 "Usage: ucolour option [option ...]" + echo >&2 "Options: -b Set background." + echo >&2 " -B Set highlight background." + echo >&2 " -c Set cursor." + echo >&2 " -f Set foreground." + echo >&2 " -F Set highlight foreground." + echo >&2 " -m Set mouse." + exit 1 +fi + +[ -n "$TMUX" ] && tmux_prefix="\033Ptmux;\033" +[ -n "$BG" ] && echo -en "$tmux_prefix\033]17;$BG\007" +[ -n "$FG" ] && echo -en "$tmux_prefix\033]19;$FG\007" +[ -n "$bg" ] && echo -en "$tmux_prefix\033]11;$bg\007" +[ -n "$cu" ] && echo -en "$tmux_prefix\033]12;$cu\007" +[ -n "$fg" ] && echo -en "$tmux_prefix\033]10;$fg\007" +[ -n "$mo" ] && echo -en "$tmux_prefix\033]13;$mo\007" +exit 0 -- 2.20.1