Permalink
Browse files

Merge pull request #2 from arsenerei/master

* minor changes to make tmx cleaner and more readable:
  * silence error output from `tmux ls`
  * consistency for tmux commands (i.e. `new-session` instead of `new`)
  • Loading branch information...
2 parents 00a3be4 + 591ef94 commit 77dda64f3de581d0545213fd7994af0578428e89 @brandur committed Aug 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 tmx
View
4 tmx
@@ -30,12 +30,12 @@ base_session="$1"
tmux_nb=$(trim `tmux ls | grep "^$base_session" | wc -l`)
if [[ "$tmux_nb" == "0" ]]; then
echo "Launching tmux base session $base_session ..."
- tmux new -s $base_session
+ tmux new-session -s $base_session
else
# Make sure we are not already in a tmux session
if [[ -z "$TMUX" ]]; then
# Kill defunct sessions first
- old_sessions=$(tmux ls | egrep "^[0-9]{14}.*[0-9]+\)$" | cut -f 1 -d:)
+ old_sessions=$(tmux ls 2>/dev/null | egrep "^[0-9]{14}.*[0-9]+\)$" | cut -f 1 -d:)
for old_session_id in $old_sessions; do
tmux kill-session -t $old_session_id
done

0 comments on commit 77dda64

Please sign in to comment.