tmux : tr and tn now use current dir name by default.
This commit is contained in:
parent
bd7badeeb2
commit
2c55a5e61e
|
@ -610,8 +610,8 @@ Command|Description
|
|||
`ta [NAME]`|Attach to session by name. Default is `main`.
|
||||
`td`|Detach from session.
|
||||
`tl`|List all sessions.
|
||||
`tr`|Rename session.
|
||||
`tn`|Name window.
|
||||
`tr [NAME]`|Rename session. Uses current dir name by default.
|
||||
`tn [NAME]`|Name window. Uses current dir name by default.
|
||||
`tk [NAME]`|Kill session. Default is `main`.
|
||||
`tka`|Kill all sessions.
|
||||
|
||||
|
|
|
@ -18,11 +18,27 @@ alias td="tmux detach-client"
|
|||
# list.
|
||||
alias tl="tmux list-sessions"
|
||||
|
||||
# rename.
|
||||
alias tr="tmux rename-session"
|
||||
# Rename current session. Uses current dir name by default.
|
||||
# Usage: tr [NAME]
|
||||
tr()
|
||||
{
|
||||
local name="${1}"
|
||||
|
||||
# assign name (to window).
|
||||
alias tn="tmux rename-window"
|
||||
[[ "${name}" = "" ]] && name="${PWD##*/}"
|
||||
|
||||
tmux rename-session "${name}"
|
||||
}
|
||||
|
||||
# Assign name (to window). Uses current dir name by default.
|
||||
# Usage: tn [NAME]
|
||||
tn()
|
||||
{
|
||||
local name="${1}"
|
||||
|
||||
[[ "${name}" = "" ]] && name="${PWD##*/}"
|
||||
|
||||
tmux rename-window "${name}"
|
||||
}
|
||||
|
||||
# kill specified session or default one.
|
||||
tk()
|
||||
|
|
Reference in a new issue