Skip to content

Commit

Permalink
wemux users now works on old versions of tmux
Browse files Browse the repository at this point in the history
tmux 1.5 is still being distributed with many package managers and it turns out
the formatting options for list-clients were added in 1.6. Removed usage of
formatting options, getting correct columns with cut instead.
  • Loading branch information
zolrath committed Mar 29, 2012
1 parent f3862d0 commit 3a8653d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wemux
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
###############################################################################

# Current wemux version.
version="2.2.2"
version="2.2.3"

# Setup and Configuration Files.
# Default settings, modify them in the /etc/wemux.conf file:
Expand Down Expand Up @@ -159,12 +159,12 @@ status_users() {
# Get user associated with tty
name=`stat -f%Su $tty 2>/dev/null` || name=`stat -c%U $tty 2>/dev/null`
# If user is attached in read-only mode, set mode to [m]
[[ $mode == 0 ]] && mode="" || mode="[m]"
[[ $mode == "(ro)" ]] && mode="[m]" || mode=""
# If user/mode is already is userlist, do not add them again.
if ! [[ "$users" =~ "$name$mode," ]]; then
users="$users$name$mode, "
fi
done < <(wemux list-clients -F "#{client_tty},#{client_readonly}" | tr ',' ' ')
done < <(wemux list-clients | cut -f1,6 -d ' ' | sed s/://)
# Strip last two characters ', '
echo "${users%??}"
else
Expand Down

0 comments on commit 3a8653d

Please sign in to comment.