1
0
Fork 0
mirror of synced 2024-12-04 06:35:37 -05:00

Compare commits

...

2 commits

View file

@ -144,7 +144,7 @@ bind P choose-buffer # choose which buffer to paste from
# -- 8< ------------------------------------------------------------------------
%if #{==:#{TMUX_PROGRAM},}
run "exec sh -c 'TMUX_PROGRAM=\"\$(LSOF=\$(PATH=\"\$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" command -v lsof); \$LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e \"if (s/^n((?:.(?!dylib\$|so\$))+)\$/\\1/g && s/(?:\s+\\([^\\s]+?\\))?\$//g) { print; exit } } exit 1; {\" 2>/dev/null || readlink \"/proc/#{pid}/exe\" 2>/dev/null)\"; [ x\"\$(\"\$TMUX_PROGRAM\" display -p \"#{l:#{pid}}\" 2>/dev/null)\" = x\"#{pid}\" ] || TMUX_PROGRAM=\"\$(command -v tmux || printf tmux)\"; \"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_PROGRAM \"\$TMUX_PROGRAM\"'"
run "exec sh -c 'TMUX_PROGRAM=\"\$(LSOF=\$(PATH=\"\$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" command -v lsof); \$LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e \"if (s/^n((?:.(?!dylib\$|so\$))+)\$/\\1/g && s/(?:\s+\\([^\\s]+?\\))?\$//g) { print; exit } } exit 1; {\" 2>/dev/null || readlink \"/proc/#{pid}/exe\" 2>/dev/null)\"; [ \"\$(\"\$TMUX_PROGRAM\" display -p \"#{l:#{pid}}\" 2>/dev/null)\" = \"#{pid}\" ] || TMUX_PROGRAM=\"\$(command -v tmux || printf tmux)\"; \"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_PROGRAM \"\$TMUX_PROGRAM\"'"
%endif
%if #{==:#{TMUX_SOCKET},}
run "exec sh -c '\"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_SOCKET \"#{socket_path}\"'"
@ -614,7 +614,7 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# case "$_uname_s" in
# *CYGWIN*)
# ps -al | tail -n +2 | awk -v pane_pid="$pane_pid" -v tty="$pane_tty" -v ssh="$(command -v ssh)" '
# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ &!/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty {
# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty {
# user[$1] = $6; if (!child[$2]) child[$2] = $1
# }
# END {
@ -1500,11 +1500,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# status_right="#(echo; nice cut -c3- '$TMUX_CONF' | sh -s _battery_status '$tmux_conf_battery_status_charging' '$tmux_conf_battery_status_discharging')$status_right"
# interval=60
# if [ "$_tmux_version" -eq 3500 ]; then
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# elif [ "$_tmux_version" -ge 3200 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# elif [ "$_tmux_version" -ge 2800 ]; then
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
# elif [ "$_tmux_version" -gt 2400 ]; then
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
# else
@ -1557,11 +1557,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# ;;
# esac
# if [ "$_tmux_version" -eq 3500 ]; then
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# elif [ "$_tmux_version" -ge 3200 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# elif [ "$_tmux_version" -ge 2800 ]; then
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
# elif [ "$_tmux_version" -gt 2400 ]; then
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
# else
@ -1579,11 +1579,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
# interval=$(tmux show -gv status-interval)
# if [ "$_tmux_version" -eq 3500 ]; then
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
# elif [ "$_tmux_version" -ge 3200 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
# elif [ "$_tmux_version" -ge 2800 ]; then
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
# elif [ "$_tmux_version" -gt 2400 ]; then
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
# else