Tmux & Container : Kill by current dir name.
This commit is contained in:
parent
c153a75507
commit
48f6407cc2
|
@ -6,7 +6,7 @@ function ca() {
|
|||
|
||||
# Set default name.
|
||||
# [[ "${name}" = "" ]] && name="main"
|
||||
[[ "${name}" = "" ]] && name="${PWD##*/}"
|
||||
[[ "${name}" = "" ]] && name=$(parse_simplify "${PWD##*/}")
|
||||
|
||||
# Append box prefix.
|
||||
name="box-${name}"
|
||||
|
@ -33,13 +33,13 @@ function ca() {
|
|||
}
|
||||
|
||||
# Remove container box with specified name.
|
||||
# By default uses `main` name.
|
||||
# By default uses current dir name.
|
||||
# Usage: ck [NAME]
|
||||
function ck() {
|
||||
local name="${1}"
|
||||
|
||||
# Set default name.
|
||||
[[ "${name}" = "" ]] && name="main"
|
||||
[[ "${name}" = "" ]] && name=$(parse_simplify "${PWD##*/}")
|
||||
|
||||
# Append box prefix.
|
||||
name="box-${name}"
|
||||
|
|
|
@ -6,7 +6,7 @@ function ta() {
|
|||
|
||||
# Set default name.
|
||||
# [[ "${name}" = "" ]] && name="main"
|
||||
[[ "${name}" = "" ]] && name="${PWD##*/}"
|
||||
[[ "${name}" = "" ]] && name=$(parse_simplify "${PWD##*/}")
|
||||
|
||||
# Create session.
|
||||
tmux new-session -s "${name}" -d &> /dev/null
|
||||
|
@ -55,18 +55,14 @@ function tnw() {
|
|||
}
|
||||
|
||||
# Kill specified session.
|
||||
# By default it kills `main` session.
|
||||
# By default uses current dir name.
|
||||
# Usage: tk [NAME]
|
||||
function tk() {
|
||||
# set default name.
|
||||
if [[ "${1}" = "" ]]; then
|
||||
1="main"
|
||||
fi
|
||||
local name="${1}"
|
||||
|
||||
# call tmux.
|
||||
for name in "$@"; do
|
||||
tmux kill-session -t "${name}"
|
||||
done
|
||||
[[ "${name}" = "" ]] && name=$(parse_simplify "${PWD##*/}")
|
||||
|
||||
tmux kill-session -t "${name}"
|
||||
}
|
||||
|
||||
# Kill all sessions.
|
||||
|
|
Reference in a new issue