wouterdebie / i2cssh

csshX like ssh tool for iTerm2
MIT License
547 stars 68 forks source link

i2cssh Breaks without iTerm "Default" profile available #80

Closed chrisagiddings closed 1 year ago

chrisagiddings commented 6 years ago

ISSUE

I removed the Default profile in iTerm2 because it didn't suit my needs. The following error is received:

localhost% i2cssh rpsdev rpsdevb
/Library/Ruby/Gems/2.3.0/gems/rb-scpt-1.0.2/lib/rb-scpt.rb:542:in `_send_command': CommandError (Appscript::CommandError)
        OSERROR: 1
        MESSAGE: No profile exists named 'Default'
        COMMAND: app("/Applications/iTerm.app").create_window_with_profile("Default", {:command=>"/usr/bin/env bash -l"})
    from /Library/Ruby/Gems/2.3.0/gems/rb-scpt-1.0.2/lib/rb-scpt.rb:642:in `method_missing'
    from /Library/Ruby/Gems/2.3.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:21:in `initialize'
    from /Library/Ruby/Gems/2.3.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `new'
    from /Library/Ruby/Gems/2.3.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `<top (required)>'
    from /usr/local/bin/i2cssh:22:in `load'
    from /usr/local/bin/i2cssh:22:in `<main>'

ATTEMPT

Changing this value on line 194 in the indicated file: /Library/Ruby/Gems/2.3.0/gems/i2cssh-2.2.0/bin/i2cssh, and I did not see another occurrence of the "Default" profile name in this file.

I am new to i2cssh (hello new friends) but familiar with both cssh and csshX.

ENVIRONMENT

This is a fresh install of i2cssh with no custom configuration yet in place.

RECOMMEND

I recommend having i2cssh select the first profile in the iTerm(2) configuration file if it finds the "Default" profile does not exist.

If i2cssh cannot find any available profile, perhaps it could break out more gracefully.

As a note, my remote machines all have various profiles assigned, so the profile with auto-switch once I am logged in… so the initially loaded profile doesn't matter.

WORKAROUND

Specifying the -p argument and a valid profile name (Local in my case) works as designed and opens a new window with multiple panes.

localhost% i2cssh -p Local rpsdev rpsdevb

joelboekankamp commented 6 years ago

Had the same error as described but my issue was slightly different because I actually had a Default profile still, yet same exact error message. My fix ended up being the same as described in #29 where I had a second copy of the app somehow in my Downloads folder. Once I removed the second copy of the app I no longer received this error.