Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I forgot to start screen before I started working, and now I've SSH'd into my machine from my laptop. ps -a gives me the process ID of the vim process. Can I steal the vim session from my other terminal and attach it to my ssh session?

share|improve this question
    
kill it and recover the swap file (vi -r filename) could be ok for you? –  Davide Berra Jan 30 '13 at 19:43
add comment

migrated from stackoverflow.com Jan 30 '13 at 20:15

This question came from our site for professional and enthusiast programmers.

2 Answers

The reptyr program would allow you to do that.

share|improve this answer
    
this thing really works! –  sivann Jan 31 '13 at 13:02
add comment

You could save the vim session using :mksession ~/session.vim, and reload it in screen using vim -S ~/session.vim.

:mksession essentially saves the current vim session as a file that you can pass around between terminals, or re-open once you have shut your computer down, etc.

share|improve this answer
    
Actually, if you have the clientserver option built into your executable, you should be able to remotely send the commands that @Pascal mentions to save off the running session and then close it out. You could then restore it in the term. that you are in. See ':h remote_send()' –  pottsdl Jan 31 '13 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.