Open nataraj-hates-MS-for-stealing-github opened 4 months ago
I tried another approach, and it worked. Instead of putting child into new session, as I've done in the example above, I make it it's own group. And that worked for me:
#!/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;
(setpgid($$,$$) != -1) || die "Can't create own group: $!";
sleep 10;
while (1) {print "$i\n"; sleep 1; $i++};
}
and then
reptyr [process id printed by the script above]
in another terminal
But problems, I guess. still remains:
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:I am trying to
reptyr
child to another terminal using pid it prints at the beginning, but I getAdding
-T
does not help either.Have you any idea how I can do that?