1

I want to open a VIM instance with one user account (using su), then login as another user and access the same session with that user.

Example User1: su - user2 -c vim somefile.txt

Then I want to login as User2 and then access that VIM process created by that first user. I know it's possible but I'm not sure how to do it.

Time4Tea
  • 2,366
  • So, you want to open an interactive process (VIM) with one user, and then access with another user? Question: why does the first user have to use su, but not the second one? – Time4Tea Jan 31 '18 at 14:17
  • 2
    tmux or screen are your best bets. alternately, disown or reptyr or other tricks might be used. see https://serverfault.com/questions/24425/can-i-nohup-screen-an-already-started-process or https://unix.stackexchange.com/questions/4034/how-can-i-disown-a-running-process-and-associate-it-to-a-new-screen-shell or a myriad of similar questions. the only difference here is running the initial process as a different user; personally i'd use su with tmux. – quixotic Jan 31 '18 at 15:34

0 Answers0