3

I connected to my server:

$ ssh [email protected]

While in the server, I open a dtach session with vim:

$ dtach -c \tmp\my-dtach-session-pipe vim

Then my ssh session dies. I attempt to go back to my session:

$ ssh [email protected]
$ dtach -a \tmp\my-dtach-session-pipe

I do not get vim, but instead just a blinking cursor. I cannot do anything from there, not even ctrl+c, I can only detach the dtach with ctrl+\.

How can I get my dtach session back properly? Or am I missing the idea of how dtach is supposed to behave?

N.B. I am well aware of the tmux and screen utilities.

3
  • 1
    1. Why are you using backslash? 2. Why are you use dtatch instead of (arguably wider known and easier to use) screen or tmux? 3. Wouldn't it be better to open shell session inside the dtach session in which there would be vim session? Sometimes full-screen applications gets confused by changing screen size and suspend (<kbd>C-z</kbd>) and resume (fg) fix it. Commented Jan 19, 2011 at 17:44
  • I use tmux. I would like to learn dtach so that I can learn it and use it in combination with dvtm.
    – kzh
    Commented Jan 19, 2011 at 17:56
  • @Gilles thanks for adding the dtach tag. I would have if I had enough rep.
    – kzh
    Commented Jan 20, 2011 at 4:04

2 Answers 2

3

I think you can prevent this by passing a WINCH signal to dtach:

dtach -c /tmp/my-dtach-session-pipe -r winch vim

Or at reattachment:

dtach -a /tmp/my-dtach-session-pipe -r winch
1
  • I tried dtach -a dtach-pipe -r winch and that did not seem to re-attach my vim session, either, but if I use the -r winch option on creation (-c), it does work. Now the question is, if I forget to use -r winch can I get my dtach session back?
    – kzh
    Commented Jan 19, 2011 at 21:38
1

Perhaps you did get what you want, but you need to redraw the screen? Try pressing CTRL + L.

3
  • Incidentally, how do I make ctrl+L look like a keyboard button?
    – bahamat
    Commented Jan 19, 2011 at 20:07
  • 1
    <kbd> element will give you the cool button thing, but not on comments. On another note, I had already tried ctrl+L, but it did not work, but you still get a +1 for a great suggestion.
    – kzh
    Commented Jan 19, 2011 at 20:09
  • Bummer, I was hoping that was it ;-)
    – bahamat
    Commented Jan 20, 2011 at 2:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .