Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .functions
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,18 @@ function git-clean-branches () {

echo "Use 'git-clean-branches | xargs git branch -d' to actually delete these." >&2
}

# TMUX: Create a new tmux session that shares windows with an existing session, but whose
# active window(s) remain independent of the existing session's (i.e. they don't mirror each other)
#
# USAGE: `tc 2 1` => `tmux new-session -s2 -t1`
# EXPL: This creates a new session named "2" that shares all the same windows with the session named "1"
#
# NOTE: This command will attempt to attach to a session named "0" (which is the default name) if
# a second argument isn't given:
# USAGE: `tc 2` => `tmux new-session -s2 -t0`
# EXPL: This creates a new session named "2" that shares all the same windows with the session named "0"

function tc() {
tmux new-session -s"${1}" -t"${2:-0}"
}
Loading