[tmux] Add remote session nesting
If calling a tmux session within a tmux session, pressing F12 will toggle between sending commands to the outer or inner session. If the outer session is inactive its status-bar will be slightly greyed out to show that no commands will reach it. If the inner session is a remote ssh session, it will set some additional stylings for the status-bar to further differentiate the two.
This commit is contained in:
parent
c8cd9bf11e
commit
7fab7dd6fb
4 changed files with 95 additions and 11 deletions
39
.local/bin/test/tm.bats
Normal file
39
.local/bin/test/tm.bats
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
setup() {
|
||||
fut="$BATS_TEST_DIRNAME/../tm"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -rf $BATS_TMPDIR/xdg/*
|
||||
}
|
||||
|
||||
@test "runs correctly if invoked without arguments" {
|
||||
run $fut
|
||||
echo "$BATS_TEST_DIRNAME/../tm"
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "Errors out if passed a non-existent session file (and some session name)" {
|
||||
run $fut IDONT_EXIST_HERE.session sessionname
|
||||
echo "STATUS: $output"
|
||||
[ "$status" -eq 1 ]
|
||||
echo "OUTPUT: $output"
|
||||
[ "$output" = "can not source session file: 'IDONT_EXIST_HERE.session' does not exist." ]
|
||||
}
|
||||
|
||||
@test "Runs without errors when session file exists in PWD" {
|
||||
touch $PWD/exists.session
|
||||
run $fut exists.session sessionname
|
||||
rm $PWD/exists.session
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "Runs without errors when session file exists in XDG_CONFIG_HOME/tmux/sessions/" {
|
||||
export XDG_CONFIG_HOME=$BATS_TMPDIR
|
||||
mkdir -p $XDG_CONFIG_HOME/tmux/sessions
|
||||
sesdir=$XDG_CONFIG_HOME/tmux/sessions
|
||||
touch $sesdir/exists.session
|
||||
run $fut exists.session sessionname
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue