bin/tmuxs

Mon, 01 Jan 2024 14:47:38 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 01 Jan 2024 14:47:38 -0600
changeset 1144
dc1def95331f
parent 473
049e9d356e16
permissions
-rwxr-xr-x

skip luasnip/jsregexp build on windows (oops)

#!/bin/sh
set -eu

case ${1:-} in *help|-h)
  exec perldoc -T $0;;
esac

name=${1:-$(basename `pwd`)}

if ! tmux has-session -t "$name" 2>/dev/null; then
  tmux new -d -s "$name"
fi

if [ -n "${TMUX:-}" ]; then
  exec tmux switch-client -t "$name"
else
  exec tmux attach -t "$name"
fi

:<<=cut
=head1 NAME

tmuxs - tmux session

=head1 SYNOPSIS

 tmuxs foobaz

 cd ~/proj/quux
 tmuxs
 # aka: tmuxs quux

=head1 DESCRIPTION

tmuxs attaches or switches to a session of the given name, or the cwd's name,
creating it if necessary.

=cut

mercurial