I maintain a vcs repository with my collection of dotfiles, which 
includes tmux.conf. As I like to use a common set of dot files on most 
machines I use, the config changes in the 1.6 release have left me stuck 
with pre-1.6 and 1.6 config entries to achieve the desired result on all 
machines, some of which use 1.6 and others which I have less control 
over and have not yet been updated.

I would like to request that the tmux.conf syntax include something 
similar to vim's config file evaluation, which allows conditional 
inclusion of config lines based on evaluation. The has(capability) of 
vim seems overkill, but being able to specify app versions (<,=,>) seems 
adequate.

The effected snippets of what I had:
     set -g prefix `,"C-B"
     setw -g window-status-alert-fg    colour228
     setw -g window-status-alert-attr  dim

The new content to try and cover both cases
     set -g prefix `
     set -g prefix2 "C-B" # tmux 1.6+ only
     bind ` send-prefix
     bind "C-B" send-prefix -2 # tmux 1.6+ only

     # Pre tmux 1.6
     setw -g window-status-alert-fg colour228
     setw -g window-status-alert-attr dim
     # tmux 1.6
     setw -g window-status-activity-fg colour228
     setw -g window-status-activity-attr dim
     setw -g window-status-bell-fg colour228
     setw -g window-status-bell-attr dim
     setw -g window-status-content-fg colour228
     setw -g window-status-content-attr dim

The problem is that know I am guaranteed to get error messages for the 
statements for the incorrect version, which I would like to be able to 
exclude with something like:

     set -g prefix `
     bind ` send-prefix

     if {tmuxver} < 1.6
         set -g prefix `,"C-B"
         setw -g window-status-alert-fg    colour228
         setw -g window-status-alert-attr  dim
     endif

     if {tmuxver} = 1.6
         set -g prefix2 "C-B"
         bind "C-B" send-prefix -2

         setw -g window-status-activity-fg colour228
         setw -g window-status-activity-attr dim
         setw -g window-status-bell-fg colour228
         setw -g window-status-bell-attr dim
         setw -g window-status-content-fg colour228
         setw -g window-status-content-attr dim
     endif

Joel

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to