Monday, November 25, 2024

terminal – Wrapper round ssh causes AppleEvent handler to fail

I’ve the script that I’ve pasted decrease down in my path and named ssh. The thought is that it modifications the color of the terminal based mostly on which host I am ssh-ed into. This labored effective for a very long time, however lately git has given me the error message

229:235: execution error: Terminal bought an error: AppleEvent handler failed. (-10000)

After I’m utilizing SSH straight, every little thing is ok, however one thing about different purposes calling ssh is inflicting points. After I rename this file in order that /usr/bin/ssh is used as an alternative, git works effective. I do not assume that it is resulting from git not receiving the return worth, as I am passing that onwards.

Any concepts what may very well be inflicting this?

That is the wrapper script:

#!/bin/zsh
##
## Writer: Darrin Skinner -- [email protected]
##
## https://kitepwr.wordpress.com/2014/11/07/add-color-to-your-ssh-sessions-mac-osx/
##
## This modifications the terminal coloration relying on the ssh goal setting
## and it modifications it again to the unique coloration when ssh exits
##
## Within the case assertion under, present a search sample
## and a Terminal Profile Identify to make use of for every server.
##

HOSTNAME=$@

case $HOSTNAME  in
    murk*)        COLOR="Murk"      ;; 
    fog*)         COLOR="Fog"       ;; 
    *)            COLOR="ssh"       ;; ## All the things else
esac

ORIG_COLOR=`set_term_color "$COLOR"`
/usr/bin/ssh $@
RET_VAL=$?
ORIG_COLOR=`set_term_color "$ORIG_COLOR"`

return RET_VAL

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles