mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 18:03:23 +00:00
Apply patch from Tony Mancill for "-l <user>" errors when closing terminals.
Apply patch from Gavin Brock fix the arrow keys bug Amend docs accordingly
This commit is contained in:
parent
c9966d952d
commit
972f4ef3dc
1 changed files with 36 additions and 21 deletions
|
@ -82,6 +82,7 @@ use File::Temp qw/:POSIX/;
|
||||||
use POSIX qw/ mkfifo /;
|
use POSIX qw/ mkfifo /;
|
||||||
use Fcntl;
|
use Fcntl;
|
||||||
use FindBin;
|
use FindBin;
|
||||||
|
use Term::Cap;
|
||||||
|
|
||||||
# set autoflush so we print to client correctly
|
# set autoflush so we print to client correctly
|
||||||
$|=1;
|
$|=1;
|
||||||
|
@ -104,6 +105,12 @@ setup_OS(); # and now call it
|
||||||
|
|
||||||
sub KILLOFF { return 0xEE }; # quit signal to send to xterm clients
|
sub KILLOFF { return 0xEE }; # quit signal to send to xterm clients
|
||||||
|
|
||||||
|
# Load Term::Cap entries (Assuming children are same type as parent)
|
||||||
|
my $termios = new POSIX::Termios;
|
||||||
|
$termios->getattr;
|
||||||
|
my $ospeed = $termios->getospeed;
|
||||||
|
my $terminal = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed };
|
||||||
|
|
||||||
# This is the process by which we get around requiring setuid while also
|
# This is the process by which we get around requiring setuid while also
|
||||||
# only running from one script
|
# only running from one script
|
||||||
if($options{x})
|
if($options{x})
|
||||||
|
@ -586,23 +593,29 @@ $mw_entry->bind('<<Paste>>' => sub {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
# we currently can only deal with ASCII codes, and i cannot find a way to
|
# we currently can only deal with ASCII codes, so any unusual
|
||||||
# convert keysyms to control codes to send those the terminals, so arrow
|
# keys must be converted, i.e. arrow keys.
|
||||||
# keys and other such ones are out
|
|
||||||
$mw->bind('<Key>' => sub {
|
$mw->bind('<Key>' => sub {
|
||||||
my $char=$Tk::event->A;
|
my $char=$Tk::event->A;
|
||||||
my $ascii=ord($Tk::event->A);
|
my $ascii=ord($Tk::event->A);
|
||||||
|
|
||||||
#my $deckeysym=$Tk::event->N;
|
if(!$ascii)
|
||||||
#my $keysym=$Tk::event->K;
|
{
|
||||||
#my $keycode=$Tk::event->k;
|
my $keysym=$Tk::event->K;
|
||||||
|
if (my $termsym = {
|
||||||
#$char=sprintf("%c", $deckeysym);
|
'Up' => 'ku',
|
||||||
|
'Right' => 'kr',
|
||||||
#print "char:$char: ascii:$ascii: deckeysym:$deckeysym keysym:$keysym: keycode:$keycode:\n";
|
'Down' => 'kd',
|
||||||
|
'Left' => 'kl',
|
||||||
return if ($ascii eq 0); # catch all for control keys
|
}->{$keysym}) {
|
||||||
#$char=chr($Tk::event->N) if ($ascii eq 0); # catch all for control keys
|
for (split(//, $terminal->Tputs($termsym)))
|
||||||
|
{
|
||||||
|
send_character($_);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return; # catch all for unhandled control keys
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!(keys(%servers)))
|
if (!(keys(%servers)))
|
||||||
{
|
{
|
||||||
|
@ -623,7 +636,7 @@ sub delete_host
|
||||||
# grab a link to the hosts menu so we can work on it
|
# grab a link to the hosts menu so we can work on it
|
||||||
my $menu=$mw_mb->entrycget('Hosts', -menu);
|
my $menu=$mw_mb->entrycget('Hosts', -menu);
|
||||||
|
|
||||||
$serv=~ s/.*@// if ($serv =~ /@/);
|
$serv=~ s/.*@// if ($serv =~ /$ENV{LOGNAME}@/);
|
||||||
|
|
||||||
# now remove the menu entry
|
# now remove the menu entry
|
||||||
$menu->delete($serv);
|
$menu->delete($serv);
|
||||||
|
@ -1097,11 +1110,8 @@ When Tk 804.xxx and perl 5.8.0 are much more widely spread i will fix this bug.
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
Only ASCII codes can be sent to child terminals, so arrow keys and such
|
Only ASCII codes can be sent to child terminals, so arrow keys and such
|
||||||
cannot currently be used
|
have to be converted. The arrow keys should work - please post to the
|
||||||
|
web site for any others that are required and do not work.
|
||||||
=item *
|
|
||||||
|
|
||||||
Closing terminals too quickly may cause a spurious error dump
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1111,8 +1121,8 @@ Closing terminals too quickly may cause a spurious error dump
|
||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
If you require support of any nature, please run the following commands
|
If you require support, please run the following commands
|
||||||
and send the output to the author, or report it on the web site:
|
and post it on the web site in the support/problems forum:
|
||||||
|
|
||||||
$ perl -V
|
$ perl -V
|
||||||
|
|
||||||
|
@ -1206,6 +1216,11 @@ L<Config::Simple>
|
||||||
# Moved to sf.net cvs
|
# Moved to sf.net cvs
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 2.4 2004/04/13 12:19:50 duncan_ferguson
|
||||||
|
# Apply patch from Tony Mancill for "-l <user>" errors when closing terminals.
|
||||||
|
# Apply patch from Gavin Brock fix the arrow keys bug
|
||||||
|
# Amend docs accordingly
|
||||||
|
#
|
||||||
# Revision 2.3 2004/04/06 15:33:45 duncan_ferguson
|
# Revision 2.3 2004/04/06 15:33:45 duncan_ferguson
|
||||||
# fix use of user@server in /etc/clusters
|
# fix use of user@server in /etc/clusters
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue