what do you do if you opened a file in vim in a different terminal?
reptyr PID_OF_VIM
(you can find the PID in the message that vim gives you)
But in more recent systems this may fail. The reason is limitations on ptrace.
So a potential workaround is to temporarily remove this limitation:
sudo sysctl kernel.yama.ptrace_scope=0
reptyr PID_OF_VIM
sudo sysctl kernel.yama.ptrace_scope=1