I'm trying to use an if function and not having much luck.
set -g pane-border-format '\
#[fg=colour235,bg=colour000]\
#[fg=colour231,bg=colour235] #I:#{pane_index} \
{if-shell "[ ''#(ps -f --no-headers --ppid #{pane_pid} -o args)'' =
''#()'' ] \
"#{pane_current_command}" \
"#(ps -f --no-headers --ppid #{pane_pid} -o args | sed -e "s/[ ]* / /g"
| sed -e "s/\/home\/#(whoami)/~/" )"} \
#[fg=colour235,bg=colour000,nobold]'
# This looks nice, plus is in the format:
# < #:# current-command with arguments >
# To do this I've grabbed the #{pane_current_command} (which has no
arguments), so
# there's always something (e.g. 'zsh'), as otherwise when #{ps
-'etc'} (which has
# arguments) is run, I get a blank output.
# I considered running both and with the #{ps -'etc'} command I've
just removed
# the #{pane_current_command} with 'sed'. This doesn't work when
running functions that
# are interpreted by my .zshrc though, hence why I'm trying this if
function
With this, I get everything working how I want it, apart from the if
function, which I can't seem to get either an output from or initialise the
if function.
Here's the output from the above code:
< 1:0 {if-shell "[ vim /home/me/.tmux.conf = ]" "vim" "vim ~/.tmux.conf"} >
-- Thanks in advance, Greg
--
You received this message because you are subscribed to the Google Groups
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.