Warm tip: This article is reproduced from serverfault.com, please click

One perl script many "terminals" (tmux panes)

发布于 2020-11-28 19:50:47

How to make perl script start tmux child process with a few (2) tmux panes seen by the script as (write only) file descriptors?

#!/usr/bin/perl

sub get_handles {
   # some tmux magic    

   return @handles; # return array of two file descriptors, preferably IO::Handle
}

I need it for script using AnyEvent module (or threads).

Questioner
AnFi
Viewed
0
AnFi 2020-12-26 20:53:40

https://github.com/tmux/tmux/issues/567 gives exaple how to get list of pseudo terminal devices (file paths).

tmux list-panes -F'#{pane_tty} #{pane_id}'