netkit-jh / netkit-jh-build

Build scripts for the kernel, filesystem and assisting scripts/programs for Netkit-JH.
https://netkit-jh.github.io/
GNU General Public License v3.0
22 stars 12 forks source link

Fix Issue #136: Match tmux session names exactly #137

Closed AdamBromiley closed 1 year ago

AdamBromiley commented 1 year ago

Fix for Issue #136, where Netkit would falsely report a tmux session as existing if its session name was a prefix of an existing session name. I.e.:

tmux -L netkit new-session -s "foobar"

tmux -L netkit has-session -t "foo" # returns true, Netkit fails creating a tmux session for "foo"

This PR uses tmux's exact match operator:

tmux -L netkit new-session -s "foobar"

tmux -L netkit has-session -t "=foo" # returns false, Netkit succeeds creating a tmux session for "foo"

tmux -L netkit has-session -t "=foobar" # returns true, as expected

This is documented behaviour of tmux.