3

I am using cssh (cluster-ssh) to ssh to multiple machines simultaneously. Everything works great, except that cssh intercepts F10 key (which in cssh opens menu.

This is very unfortunate, because I am using F10 a lot, for example to close midnight commander.

Is there a way to configure cssh so that it ignores F10 and lets it through ?

I am using LXDE/Openbox on Debian Wheezy

UPDATE: in the past, I had similar problem with terminator terminal emulator eating F10 when using midnight commander. This problem was resolved by adding the following to my /usr/share/themes/Clearlooks/gtk-2.0/gtkrc

binding "NoKeyboardNavigation" {
    unbind "<shift>F10"
}

class "*" binding "NoKeyboardNavigation"

This however has no effect on cssh. Therefore I suspect, this is not caused by the window manager, but rather by cssh itself.

Martin Vegter
  • 69
  • 66
  • 195
  • 326
  • 1
    Try pressing `ESC` `0` instead of `F10`, that may work. – Martin von Wittich Oct 20 '14 at 15:38
  • @Martin von Wittich - thanks, Esc+0 works. But it is impractical, because I am so used to F10. – Martin Vegter May 27 '15 at 07:37
  • @Christopher - `ps` is showing `/usr/bin/xterm` in the process list. So I guess yes. – Martin Vegter May 28 '15 at 19:28
  • @Christopher - BTW, as a side note: does it mean `cssh` can use other terminal emulators than xterm? Would it be possible to tell `cssh` to open the terminals in `terminator`, for instance ? – Martin Vegter May 28 '15 at 19:43
  • @Christopher - thanks a lot. I am getting some errors, however. But since this is a diferent issue, I have created a new [question](http://unix.stackexchange.com/questions/206263/cssh-change-terminal-from-xterm-to-terminator) – Martin Vegter May 29 '15 at 08:13

1 Answers1

4

This behavior isn't actually part of cssh, but rather the widget toolkit it's using, Tk, which is why it doesn't show up in the list of configurable hotkeys and setting use_hotkeys to no doesn't disable it. I couldn't find a non-programmatic way to fix it, but if you're building cssh yourself (not hard) you can make a small change to the code to rebind F10 so it does nothing. Add the following line to lib/App/ClusterSSH.pm in the create_menubar() function:

$windows{main_window}->bind("all", "<Key-F10>" => sub {});

Patch:

diff --git a/lib/App/ClusterSSH.pm b/lib/App/ClusterSSH.pm
index cc71507..de4706e 100644
--- a/lib/App/ClusterSSH.pm
+++ b/lib/App/ClusterSSH.pm
@@ -1737,6 +1737,7 @@ sub create_menubar() {
     my ($self) = @_;
     $self->debug( 2, "create_menubar: started" );
     $menus{bar} = $windows{main_window}->Menu();
+    $windows{main_window}->bind("all", "<Key-F10>" => sub {});
     $windows{main_window}->configure( -menu => $menus{bar}, );

     $menus{file} = $menus{bar}->cascade(
Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232