Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csshx is not working in New Mac OS Release MacOS Mojave #94

Open
ghost opened this issue Jul 2, 2018 · 59 comments
Open

csshx is not working in New Mac OS Release MacOS Mojave #94

ghost opened this issue Jul 2, 2018 · 59 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2018

csshx is not working in New Mac OS Release MacOS Mojave.

Getting the following errors :

$ ./csshX host1 host2 host3 host4
**** ERROR **** PerlObjCBridge:: sendObjcMessage: Can't get NSMethodSignature for message "qualifiedSpecifier"
**** ERROR **** PerlObjCBridge: error [1] sending message [NSObject qualifiedSpecifier] at /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/PerlObjCBridge.pm line 248.
$

@banyartibi
Copy link

For me the error is:

Can't call method "qualifiedSpecifier" on unblessed reference at /usr/local/bin/csshx line 524.

If I add print commands to Line 523 I get the same like you.

history -d $(($HISTCMD-1)) && clear && exec '/usr/local/bin/csshx' '--master' '--sock' '/var/tmp/tmp.0.COSUMX' '--launchpid' '64635' '--screen' '0' '--debug' '0' '--tile_y' '0' '--tile_x' '0'
**** ERROR **** PerlObjCBridge:: sendObjcMessage: Can't get NSMethodSignature for message "qualifiedSpecifier"
**** ERROR **** PerlObjCBridge: error [1] sending message [NSObject qualifiedSpecifier] at /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/PerlObjCBridge.pm line 248.

@bessudnov
Copy link

Same issue

@parera10
Copy link

parera10 commented Aug 1, 2018

Same error here.

With the last Mojave Beta and csshX versoin.

@emotality
Copy link

Same here 😞

@devros42
Copy link

Same :( anyone know of an alternative?

@bessudnov
Copy link

I set up iTerm 2
I tagged profiles and then open it with top bar menu, that i turn on “Broadcast input to all tabs”

@parera10
Copy link

You can try tmux-cssh but it's not the same.

@rdelpret
Copy link

unfortunately the original dev / project doesn't look very active anymore.

@sradu
Copy link

sradu commented Sep 25, 2018

What have you gals/guys switched to using instead of csshx?

@pkovtunov
Copy link

pkovtunov commented Sep 25, 2018

Hi, I've just hot-fixed it by cherry-picking old stuff from 2010.

just replace open_window with this and it should work.

sub open_window {
    my ($pack, @args) = @_;

    # Quote the command arguements
    my $cmd = join ' ', map { s/(["'])/\\$1/g; "'$_'" } @args;

    # don't exec if debugging so we can see errors
    $cmd = "clear && exec $cmd" unless $config->debug;

    # Hide the command from any shell history
    $cmd = 'history -d $(($HISTCMD-1)) && '.$cmd if get_shell =~ m{/(ba)?sh$};
    # TODO - (t)csh, ksh, zsh 

    my $tabobj = $terminal->doScript_in_($cmd, undef) || return;
    my $tty = $tabobj->tty->UTF8String || return;

    my $windows = $terminal->windows;
     # Quickly check if the tty even exists, since the next code is REALLY slow
    #return unless grep { $tty eq $_ } @{Foundation::perlRefFromObjectRef $windows->valueForKey_("tty")};
    for (my $n=0; $n<$windows->count; $n++) {
        my $window = $windows->objectAtIndex_($n);
        my $tabs = $window->tabs;
        for (my $m=0; $m<$tabs->count; $m++) {
            my $tab = $tabs->objectAtIndex_($m);
            if ($tab->tty && ($tab->tty->UTF8String eq $tty)) {
                my $obj = ref $pack ? $pack : $pack->SUPER::new();
                $obj->set_windowid("".$window->id);
                $obj->set_tabid($m);
                return $obj;
            }
        }
    }
}

@viratgohil viratgohil mentioned this issue Sep 25, 2018
@omgp0ni3s
Copy link

What have you gals/guys switched to using instead of csshx?

I believe Iterm2 has this functionality built in. Haven't tried it though.

@ghost
Copy link
Author

ghost commented Sep 26, 2018

@pkovtuov Thanks for your tips/additional stuffs. When I try, I got this error :

[I] kylix3511$ sh csshX host1 host2
Can't call method "tty" on unblessed reference at ./csshX line 522.
[I] kylix3511$

Any idea ?

@zoil
Copy link

zoil commented Sep 27, 2018

Thank you @pkovtuov
@kylix3511 make sure you're executing it from Terminal.app (not iTerm)

@ghost
Copy link
Author

ghost commented Sep 27, 2018

Thanks So much @pkovtuov @zoil @omgp0ni3s It works as expected. Thanks so much.

@parera10
Copy link

parera10 commented Sep 28, 2018

Thanks to @viratgohil and @pkovtuov. I've forked this repos and applied the pull request from @viratgohil. Additionally I've added the homebrew formula so you can install it with homebrew:

If you already have installed it:
brew remove csshx
Then add the tap:
brew tap parera10/csshx
Then install it again:
brew install parera10/csshx/csshx

@lowbatteries
Copy link

@parera10 thanks!
Your instructions left me still installing the original (the pin didn’t seem to stick), I needed to run:
brew install parera10/csshx/csshx

@rinchen
Copy link

rinchen commented Oct 1, 2018

I can confirm that brew install parera10/csshx/csshx works as before on Mojave. Thanks!

@rdelpret
Copy link

rdelpret commented Oct 1, 2018

Thank you @parera10 !!!!

@wolf3142
Copy link

wolf3142 commented Oct 2, 2018

@parera10 worked like a charm; thank you!
@zoil is there anyway to have this executable from iTerm2?

@vincentkersten
Copy link

@parera10 Thank you, works here as well!

@zoil
Copy link

zoil commented Oct 3, 2018

@wolf3142 I'm not sure about that one, sorry.

@tholu
Copy link

tholu commented Oct 5, 2018

@parera10 Thanks for the fix! Why was the original csshx on 0.74 and your version is tagged with 0.73.2?

Uninstalling /usr/local/Cellar/csshx/0.74... (4 files, 85.1KB)

==> Installing csshx from parera10/csshx
==> Downloading https://github.com/parera10/csshx/archive/0.73-2.tar.gz
==> Downloading from https://codeload.github.com/parera10/csshx/tar.gz/0.73-2
######################################################################## 100.0%
🍺  /usr/local/Cellar/csshx/2: 4 files, 92.3KB, built in 6 seconds

I'm also getting this error:

Can't call method "tty" on unblessed reference at /usr/local/bin/csshx line 526.

And the brew info on your csshx is misleading (lists 0.74 as version, refers old repository).

@parera10
Copy link

parera10 commented Oct 5, 2018 via email

@jockjiang
Copy link

it works for me. thanks.

@martinbehrens
Copy link

Thanks @parera10

@rinchen
Copy link

rinchen commented Oct 14, 2018

I had to reinstall @parera10 's repo and it's throwing an error now


Error: parera10/csshx/csshx: /usr/local/Homebrew/Library/Taps/parera10/homebrew-csshx/Formula/csshx.rb:3: syntax error, unexpected <<, expecting keyword_end
<<<<<<< HEAD
^
/usr/local/Homebrew/Library/Taps/parera10/homebrew-csshx/Formula/csshx.rb:8: syntax error, unexpected ===, expecting keyword_end

^
/usr/local/Homebrew/Library/Taps/parera10/homebrew-csshx/Formula/csshx.rb:12: syntax error, unexpected >>, expecting keyword_end

Adding homebrew Formula
^

@wolf3142
Copy link

CsshX stopped working for me today as well....

@parera10
Copy link

parera10 commented Oct 16, 2018 via email

@ertborTek
Copy link

I had the same issue with iTerm until today, after being prompted to allow iTerm to run AppleScript (and Terminal was mentioned but I don't remember the message exactly). If you can trigger this prompt, that may be what you need.

@thrmyn
Copy link

thrmyn commented Oct 24, 2018

$ csshx --version
csshX 0.73-38-g5c0f684
$ csshx bc0
Can't call method "tty" on unblessed reference at /usr/local/bin/csshx line 526.

Still getting the same error. Anybody has any ideas on how to solve the problem.

Try upgrading your iTerm2 to the latest version. After upgrading the latest version of iTerm2, and runn csshX, the system prompts you for AppleScript permissions, authorization restart iTerm2.

I solved the problem.

I'm using iTerm2 version is 3.12.

@ogmueller
Copy link

I tried everything above and still couldn't solve the problem, until I removed ALL my downloads. I assume, that brew took the previously downloaded csshX for any reason.

$ rm /Users/myself/Library/Caches/Homebrew/downloads/*
6078c4a6435b5069dbf5175ee67f855c24e4f32890fbd133fe36983926c4ce4d--csshx-0.73-2.tar.gz
abc7997d12fc8cc2711c5914c9b8058938c683d2889de71bc761b05a40e148ff--gpgme-1.12.0.mojave.bottle.tar.gz
bead6bec5173819dc247e5d51570b6c9988a7c6dd040e024fa12bbc4829e9f65--csshX-0.74.tgz

after removing all downloads I did:

brew tap parera10/csshx
brew install parera10/csshx/csshx

solved my problem.

@grzesart1978
Copy link

@ogmueller work for me too. Thank you

@rpallas
Copy link

rpallas commented Nov 5, 2018

An alternative you can use with ITerm2 is https://github.com/wouterdebie/i2cssh - it opens separate split panes within ITerm rather than using Terminal.

Once open, you can use [Shift]+[CMD]+[I] to send input to all split panes at once

gem install i2cssh

@amcguign
Copy link

amcguign commented Nov 9, 2018

Thanks @parera10 - works great for me!

@jiayuasu
Copy link

Thanks @parera10! It works for me!

@cmholm
Copy link

cmholm commented Nov 17, 2018

Thanks @parera10! Works! As @ogmueller said, I needed to:

brew install parera10/csshx/csshx

@archanmishra
Copy link

thanks @parera10 works for me with latest iterm
thanks @cmholm i followed your method

brew install parera10/csshx/csshx

@wsgzao
Copy link

wsgzao commented Nov 27, 2018

使用 csshX 同步管理多个 SSH 会话 - https://wsgzao.github.io/post/csshx/

# It works on macOS Mojave 10.14.1 (18B75)
brew install parera10/csshx/csshx

@tholu
Copy link

tholu commented Nov 28, 2018

Anybody looking for an alternative, I found tmux-cssh today and I really like it. Nonetheless, I would still consider switching back to csshx, when this package is officially maintained again.

@federicoaaguirre
Copy link

hi there, after hours and hours I've finally found a workaround simple, friendly and works like a charm.

https://github.com/wouterdebie/i2cssh It really works perfectly.!

Enjoy it.!
FA

@x86txt
Copy link

x86txt commented Dec 10, 2018

$ csshx --version
csshX 0.73-38-g5c0f684
$ csshx bc0
Can't call method "tty" on unblessed reference at /usr/local/bin/csshx line 526.
Still getting the same error. Anybody has any ideas on how to solve the problem.

Try upgrading your iTerm2 to the latest version. After upgrading the latest version of iTerm2, and runn csshX, the system prompts you for AppleScript permissions, authorization restart iTerm2.

I solved the problem.

I'm using iTerm2 version is 3.12.

The latest nightly is 3.3, so how are you running 3.12?

felixjogris pushed a commit to felixjogris/csshx that referenced this issue Dec 19, 2018
@asp0585
Copy link

asp0585 commented Dec 27, 2018

The following fix is not working for latest Mojave version 10.14.2 :

brew tap parera10/csshx
brew install parera10/csshx/csshx

Did anyone else face the same issue?

@parera10 Could you please have a look, if possible?

Thanks.

@parera10
Copy link

parera10 commented Dec 27, 2018 via email

@asp0585
Copy link

asp0585 commented Dec 27, 2018

Hi, I've just tried to remove, untap and re-install again and it's working for me. Which error do you have? Regards, Guillem

El 27 dic 2018, a las 8:37, Anand Pandey @.***> escribió: The following fix is not working for latest Mojave version 10.14.2 : brew tap parera10/csshx brew install parera10/csshx/csshx Did anyone else face the same issue? @parera10 https://github.com/parera10 Could you please have a look, if possible? Thanks. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#94 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ANrzACQGDSz9jSC_-C0SJvijXiI_1uGAks5u9HjXgaJpZM4U_iK_.

Apparently, it worked this time. The extra step that I did was "brew unlink csshx" before removing the package.

Thanks.

@innnlab
Copy link

innnlab commented Jan 2, 2019

Thanks @parera10, it works for me. I am using iTerm2, it works well.
iTerm2 version: Build 3.2.6.

@MisterGee
Copy link

Hi, I've just hot-fixed it by cherry-picking old stuff from 2010.

just replace open_window with this and it should work.

sub open_window {
    my ($pack, @args) = @_;

    # Quote the command arguements
    my $cmd = join ' ', map { s/(["'])/\\$1/g; "'$_'" } @args;

    # don't exec if debugging so we can see errors
    $cmd = "clear && exec $cmd" unless $config->debug;

    # Hide the command from any shell history
    $cmd = 'history -d $(($HISTCMD-1)) && '.$cmd if get_shell =~ m{/(ba)?sh$};
    # TODO - (t)csh, ksh, zsh 

    my $tabobj = $terminal->doScript_in_($cmd, undef) || return;
    my $tty = $tabobj->tty->UTF8String || return;

    my $windows = $terminal->windows;
     # Quickly check if the tty even exists, since the next code is REALLY slow
    #return unless grep { $tty eq $_ } @{Foundation::perlRefFromObjectRef $windows->valueForKey_("tty")};
    for (my $n=0; $n<$windows->count; $n++) {
        my $window = $windows->objectAtIndex_($n);
        my $tabs = $window->tabs;
        for (my $m=0; $m<$tabs->count; $m++) {
            my $tab = $tabs->objectAtIndex_($m);
            if ($tab->tty && ($tab->tty->UTF8String eq $tty)) {
                my $obj = ref $pack ? $pack : $pack->SUPER::new();
                $obj->set_windowid("".$window->id);
                $obj->set_tabid($m);
                return $obj;
            }
        }
    }
}

Just Thank you for this

@manvishan
Copy link

super solution. thank you

@sixcorners
Copy link

sixcorners commented Mar 22, 2019

Here is a script/patch file that will apply pkovtuov's fix.

cd /usr/local/bin
patch <<"EOF"
--- a/csshX
+++ b/csshX
@@ -519,19 +519,24 @@
     # TODO - (t)csh, ksh, zsh 
 
     my $tabobj = $terminal->doScript_in_($cmd, undef) || return;
+    my $tty = $tabobj->tty->UTF8String || return;
 
-    # Get the window and tab IDs from the Apple Event itself
-    my $tab_ed = $tabobj->qualifiedSpecifier; # Undocumented call
-    my $tab_id = $tab_ed->descriptorForKeyword_(OSType 'seld')->int32Value-1;
-    my $win_ed = $tab_ed->descriptorForKeyword_(OSType 'from');
-    my $win_id = $win_ed->descriptorForKeyword_(OSType 'seld')->int32Value.'';
-
-    # Create an object unless we were passed one
-    my $obj = ref $pack ? $pack : $pack->SUPER::new();
-    $obj->set_windowid($win_id);
-    $obj->set_tabid($tab_id);
-
-    return $obj;
+    my $windows = $terminal->windows;
+     # Quickly check if the tty even exists, since the next code is REALLY slow
+    #return unless grep { $tty eq $_ } @{Foundation::perlRefFromObjectRef $windows->valueForKey_("tty")};
+    for (my $n=0; $n<$windows->count; $n++) {
+        my $window = $windows->objectAtIndex_($n);
+        my $tabs = $window->tabs;
+        for (my $m=0; $m<$tabs->count; $m++) {
+            my $tab = $tabs->objectAtIndex_($m);
+            if ($tab->tty && ($tab->tty->UTF8String eq $tty)) {
+                my $obj = ref $pack ? $pack : $pack->SUPER::new();
+                $obj->set_windowid("".$window->id);
+                $obj->set_tabid($m);
+                return $obj;
+            }
+        }
+    }
 }
EOF

@tauqueer
Copy link

Just worked for me on Mac Mojave V10.14.3

brew remove csshx
which csshx
brew tap parera10/csshx
brew install parera10/csshx/csshx
csshX --login username --hostfile

@igorfernandes
Copy link

Worked for me on Mac Mojave:

Open Security & Privacy option
Go to Automation
You'll see that iTerm can't control Terminal, just check this flag and work fine.

@corporate-gadfly
Copy link

Code from parera10/csshx worked for me on Mojave 10.14.6. Had a slight issue with zsh however. Didn't try with bash. The issue with zsh was that the windows would close immediately after tiling up properly. While trying to diagnose, I specified --debug 1 and voila, the windows were not closing any more.

Hope that helps someone.

@corporate-gadfly
Copy link

Code from parera10/csshx works for me in Catalina 10.15.1 as well in zsh only if I include --debug flag. Otherwise, the host windows close immediately.

@manvishan
Copy link

I had same issue. The issue was with hung state of terminal(not iterm2) at backend. once restarted the terminal.. it all went fine

@Gaket
Copy link

Gaket commented Jan 2, 2020

One more potential workaround.

Had the same issue when tried to run it from Intellij Idea Terminal. The fixed version mentioned above didn't work from the Idea terminal as well.

Works for me if started from the MacOs Catalina 10.15.1 Terminal app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests