#!/usr/bin/env bash

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# global vars passed to the script as arguments
CURRENT_SESSION_NAME="$1"
CURRENT_SESSION_ID="$2"

main() {
	tmux confirm -p "kill-session ${CURRENT_SESSION_NAME}? (y/n)" "run '$CURRENT_DIR/kill_session.sh \'$CURRENT_SESSION_ID\''"
}
main

#!/usr/bin/env bash

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# global vars passed to the script as arguments
CURRENT_SESSION_NAME="$1"
CURRENT_SESSION_ID="$2"

main() {
	tmux confirm -p "kill-session ${CURRENT_SESSION_NAME}? (y/n)" "run '$CURRENT_DIR/kill_session.sh \'$CURRENT_SESSION_ID''"
}
main

Fix killing current session without detaching
Fix killing current session without detaching

For some reason `tmux run-shell` requires weird syntax when it comes to shell
substitutions. Because of that session number passed to `kill_session.sh`
always had `\` character at the end. This in turn caused not closing the
session, as this invalid session number was used during session killing.
