X-Git-Url: https://git.madduck.net/etc/tmux.git/blobdiff_plain/455487e9e45cf78f4fea7fb91dab927b95e42bf4..5a98e2c3426667b039f0e182ec2855b5d49fb000:/.bin/tmux?ds=sidebyside diff --git a/.bin/tmux b/.bin/tmux index d6ff4b2..30d3017 100755 --- a/.bin/tmux +++ b/.bin/tmux @@ -20,7 +20,7 @@ tmux_session_exists() { _tmux_eval_only=1 real_tmux has-session -t "$1" } -if [ "${1:-}" = --connect-to-last ]; then +if [ "${1:-}" = last ]; then shift if [ -f "$LASTSESSIONIDFILE" ]; then UUID="$(cat $LASTSESSIONIDFILE)" @@ -41,6 +41,9 @@ fi # only without argument create a new session with a random name/id to which we # can then attach +if ! command -v uuidgen >/dev/null; then + uuidgen() { python3 -c 'import uuid; print(uuid.uuid1())'; } +fi UUID=$(uuidgen) echo "$UUID" > $LASTSESSIONIDFILE