Attention: This is only a workaround - however it seems to work flawlessly for my use-case.
Method: I created a new bash script myscript-entry.sh
which runs the main script as the actual user.
Contents of script follow.
su -c "/home/mc/myscript.sh" - mc
Execute sudo ./myscript-entry.sh
from the directory containing both scripts (or anywhere since the "entry" script uses absolute path) and the tmux commands should now be executed properly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…