urxvt - Send to all vty
10. Juni 2014 22:12

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 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:
#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})