diff --git a/sh/tmux.sh b/sh/tmux.sh index 5285186..8c5770a 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -21,9 +21,11 @@ rwx_tmux_servers() { local active=\"\$(rwx_tmux_server)\" local ifs=\"\${IFS}\" local name path text + local paths=\"\$(lsof -U | + awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\" IFS=\" \" - for path in \$(lsof -U | awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \$9}\"); do + for path in \${paths}; do name=\"\$(basename \"\${path}\")\" if [ \"\${active}\" = \"\${name}\" ]; then text=\"\${text}#[fg=green]\"