Post by SinbadI have a user defined bash function which takes one string parameter
and does some operation on that string. i want to be able to call this
function from with-in tmux and also pass the parameter from tmux
itself. how can i achieve that ?
Post by Sinbadbind-key T new-window -c "#{pane_current_path}" "bash -c 'source /etc/bash/bash_aliases; tress -f'"
tress is a function (display directory tree + size in pager)
tress ()
{
[ ! -e "$1" ] && par=$1 && shift || par=;
cat <(tree -hDC --dirsfirst --timefmt '%F' $par "$dir"|sed -r 's/([^.])\.\//\1/') <(du -sh "$dir") | less -SR
}
Also useful to read specific (or all) environment profile variables. You
Post by Sinbadbind-key m command-prompt -p "man:" "split-window -c '#{pane_current_path}' -p 90 'source /etc/profile.d/less-termcaps.sh && LESS=\"-SRiMJj.2~ --shift 5\" man %% || read -n1'"
export LESS_TERMCAP_us=$(tput smul; tput setaf 5) # underline start: underline, magenta
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) # underline end: norm
export LESS_TERMCAP_so=$(tput bold; tput rev; tput setaf 2; tput setab 0) # standout mode start: bright green, reverse
export LESS_TERMCAP_se=$(tput rmso; tput sgr0) # standout mode end: reset
export LESS_TERMCAP_mb=$(tput bold; tput setaf 5) # blinking start: bold, magenta
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # bold mode start: bold, cyan
export LESS_TERMCAP_me=$(tput sgr0) # mode end: reset
export LESS_TERMCAP_mr=$(tput rev)
export LESS_TERMCAP_mh=$(tput dim; tput setab 5)
export LESS_TERMCAP_ZN=$(tput ssubm)
export LESS_TERMCAP_ZV=$(tput rsubm)
export LESS_TERMCAP_ZO=$(tput ssupm)
export LESS_TERMCAP_ZW=$(tput rsupm)
export LESS_TERMCAP_ZZ=$(tput sgr0) # reset: do not litter 'env' output