nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.78k stars 216 forks source link

tty's echo setting not propagated #23

Open hotsphink opened 11 years ago

hotsphink commented 11 years ago

In my first test of this, I started up gdb in a terminal, then grabbed it in another terminal with reptyr. The two things I immediately noticed not working were that ^Z didn't suspend (but there's already an issue filed for that), and the receiving terminal did not echo my characters.

I was running gdb, so I entered !stty echo and it fixed it, but perhaps some of the settings should be propagated automatically? (Or something; terminals baffle me.)

nelhage commented 11 years ago

Interesting. We should be restoring the terminal state, but I can reproduce this issue, so I'll have to investigate. Thanks for the report.

nelhage commented 11 years ago

Huh. Finally digging now. It turns out gdb does put the terminal in -echo, and then does echo itself (presumably via libreadline), (which is quite common), but that after being restored, it stops echoing. I haven't yet pegged why it does so.