Recently I was sshed into my home pi server trying to sftp some big files from a remote server. Some of the transfers are huge, 30gb+. On our internet that will take a while. Not wanting to leave the shh terminal session open that whole time I used screen on the pi. Idea was to create a screen session start the transfer detach and comeback few hours later. Detaching was a bit tricky. <Ctrl><a> <d> is the default detach command for both tmux running on my mac and screen running on the pi. So when I tried to detach from the screen session tmux would detach instead. 😡
After messing with configs and some searching turns out if you press the tmux prefix key twice it sends it once to the child shell. So eventually I was able to detach from the screen session with:
<Ctrl><a> <Ctrl><a> <d>!!