Tag: urxvt
urxvt - Send to all vty
June 10, 2014, 10:12 p.m.

Ein urxvt Script, welches es ermöglicht, dass man Tastatureingaben an alle offenen
Tabs senden kann.
Benutzung: STRG drücken und das Mausrad drücken.

#Send input to all vty
#Sebastian Kricner
#tuxwave.net Juni 2012
#To use:
#Hold CTRL and press the mouse wheel.
#In the options popup select "send to all vty"

#In the latest releases of urxvt-unicode, there is a new hook called 'on_tt_write'
#which interferes with this script (introduces a loop). So comment out the function 'on_tt_write'
#in the tabbed extension.
#This may introduce other problems, see: http://lists.schmorp.de/pipermail/rxvt-unicode/2011q3/001428.html
#Personally i don´t got these. Thanks to exg on #rxvt-unicode on freenode.

sub on_init
	my ($self) = @_;
	$self->{enabled} = 0;
	push @{$self->{term}{option_popup_hook}}, sub{("send to all vty" => $self->{enabled}, sub { $self->{enabled} = shift})};

sub on_tt_write
	my ($self, $octets) = @_;
		foreach my $terminal (urxvt::termlist)
			unless($terminal == $self->{term})