Visual Studio Code
First, ssh into VM like normal:
If you are trying to edit file on VM, not Cheaha, make sure you have tmux installed on system.
# Ubuntu sudo apt install tmux # CentOS sudo yum install tmux
Now, create a tmux session and detach right away.
tmux new # Ctrl+B then D ^B d
You can exit this ssh connection now.
This time, ssh with remote command and special option
-t Force pseudo-terminal allocation.
ssh -t email@example.com "tmux -CC attach"