Test of snippet sharing
> cat ~/bin/tmux-here
#!/usr/bin/env bash
dir="${1:-${PWD}}"
rel_pwd="${dir//${HOME}/\~${USER}}"
session="${rel_pwd//./_}"
cd "$dir" || exit 1
if [ -n "$TMUX" ]; then
tmux has-session -t="$session" 2>/dev/null || tmux new-session -d -s "$session";
exec tmux switch -t="$session"
else
exec tmux new-session -A -s "${session}"
fi
Got to fix scrolling/overflow here. 😀
Probably some copy-to-clippboard button on hover would be nice too.