2 ms·
anyone using more than one session ? I usually just have one big one and script to create new one within that mux () { sessions=$(tmux list-sessions) if
by ilyt 3y ago
anyone using more than one session ? I usually just have one big one and script to create new one within that
mux () {
sessions=$(tmux list-sessions)
if echo $sessions | grep -q -P '^main:'
then
session_id=$$
tmux new-session -t main -s $session_id -d
if [ "z$1" != "z" ]
then
window=$(tmux new-window -d -P -- $@)
fi
tmux attach-session -t $session_id \; set-option destroy-unattached on \; select-window -t "$window"
else
tmux new-session -A -s main $@
fi
}
+ rofi (I know, heresy, choosing tmux session via X tool) attached to C-b s to search within window list
- planede 3y agoI use autossh+tmux for persistent ssh sessions. I don't use mosh as I use X forwarding to share the clipboard with the host, and I don't think mosh can do that. I don't really use tmux for window/pane management, I have a window manager and my terminal emulator has panes and tabs. Each autossh session gets its own tmux session on the remote side.
- scruple 3y agoYep, I have a very similar script in my home bin that I use for the same purpose. I've been using tmux this way for probably a decade at this point.