Skip to content

Detach child process to another virtual terminal #151

@nataraj-hates-MS-for-stealing-github

Description

I do want to use reptyr, so I can fork current process and put it into separate window of tmux terminal. But I still did not find any way how I can do that.
I wrote sample script:

#!/usr/bin/perl
use strict;
use POSIX;

my $pid = fork();

if ($pid)
{ 
  print "$pid\n";
  sleep 10;
  while (1) {print ".\n"; sleep 1};
} else
{
  my $i=0;
  (setsid() != -1)           || die "Can't start a new session: $!";
  sleep 10;
  while (1) {print "$i\n"; sleep 1; $i++};
}

I am trying to reptyr child to another terminal using pid it prints at the beginning, but I get

[-] Timed out waiting for child stop.

Adding -T does not help either.

Have you any idea how I can do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions