reptyr: Pull the rug out from under your tty

I have tried to put together a gif of reptyr in action. I really wanted this to work, but I’m running aground of a few quirks. See if this makes sense:


reptyr should allow you to detach a process from a tty session and yoink it into another one … if I understand the underlying idea.

So with bc running on one tty, I can yank it to the other by feeding its PID to reptyr.

Essentially you get a similar effect as you might with screen or tmux, detaching and allowing the process to continue, but freeing up the original tty.

I can see where this would be very useful for applications you started without screen/tmux, then don’t want to end.

It’s not quite working perfectly for me though, but part of it was fixable. The home page mentions the need to do this, as root:

echo 0 > /proc/sys/kernel/yama/ptrace_scope

and without it, all I got were error messages.

In addition, as you can see in the gif, there seem to be some issues with typed text not showing up in the receiving terminal. I’ll look into that, and see if there’s a way around it.

But some applications, like htop, happily jumped from one terminal to another, without skipping a beat. mc jumped, but didn’t refresh the screen until I pressed a key. bc, as you can see, seemed to respond, but lost its echoed text. It still showed results, just not the text I entered.

Those small quirks aside, and from the perspective of pure function, this is definitely a keeper. For all the times I’ve ever had to quit one session and move to another, and start over, reptyr would have saved me the trouble.

A coveted K.Mandla gold smilie for reptyr: 😀

One thought on “reptyr: Pull the rug out from under your tty

  1. Pingback: screenify: A tetchy little tool | Inconsolation

Comments are closed.