Term::Multiplexed - Detect terminal multiplexers (screen, tmux)
use Term::Multiplexed qw(multiplexed attached multiplexer);
say "Using " . multiplexer . " as terminal multiplexer";
say "Currently " . (attached ? : "not ") . "attached.";
When running scripts inside screen/tmux, it's often useful to detect this and to detect whether the multiplexer of choice is currently attached or not. This module does exactly that and nothing more.
Returns whether we are running inside a terminal multiplexer or not. Currently only screen and tmux are detected.
Returns true when the multiplexer is attached. Returns undef when called outside a multiplexed environment.
Returns false when the multiplexer is attached. Returns undef when called outside a multiplexed environment.
The name of the current multiplexer. Currently only "screen" and "tmux" are possible return values.
The full filesystem path to the socket used by the multiplexer.
Manpages: screen(1) tmux(1)
Dennis Kaarsemaker <email@example.com>
This software is placed in the public domain, no rights reserved
To install Term::Multiplexed, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.