shuttle icon indicating copy to clipboard operation
shuttle copied to clipboard

Shuttle doesn't open Iterm2 new tab or window

Open mohsinzaheer25 opened this issue 6 years ago • 6 comments

I have configured shuttle with default setting and its not opening new tab or window. I have Iterm2 stable release 3.3.6 and shuttle 1.2.9 version. When I set to "inTerminal": "current" it works. Not sure what wrong i did.

{
  "_comments": [
    "Valid terminals include: 'Terminal.app' or 'iTerm'",
    "In the editor value change 'default' to 'nano', 'vi', or another terminal based editor.",
    "Hosts will also be read from your ~/.ssh/config or /etc/ssh_config file, if available",
    "For more information on how to configure, please see http://fitztrev.github.io/shuttle/"
  ],
  "editor": "default",
  "launch_at_login": false,
  "terminal": "iTerm",
  "iTerm_version": "stable",
  "default_theme": "Homebrew",
  "open_in": "new",
  "show_ssh_config_hosts": false,
  "ssh_config_ignore_hosts": [],
  "ssh_config_ignore_keywords": [],
  "hosts": [
    {
      "cmd": "date -j",
      "name": "Terminal",
      "inTerminal": "tab"
    },
    {
      "Spouses Servers": [
        {
          "cmd": "echo '—->WARNING! Running commands<-- Are you sure? y/n'; read sure; if [ $sure == y ]; then echo running command && ps aux | grep [a]pple; else echo save to history and show... && history -s 'ps aux | grep [a]pple' && osascript -e 'tell application \"System Events\" to keystroke \"p\" using {control down}'; fi",
          "inTerminal": "current",
          "name": "Logs - Opens in the current active terminal window"
        },
        {
          "Jane’s Servers": [
            {
              "cmd": "ssh [email protected]",
              "inTerminal": "tab",
              "name": "SSH blog - Opens in Tab of active window",
              "theme": "basic",
              "title": "title of tab"
            },
            {
              "cmd": "ssh [email protected]",
              "inTerminal": "new",
              "name": "SSH Shop - Opens in New Window",
              "theme": "basic",
              "title": "title of new window"
            }
          ]
        }
      ]
    }
  ]
}

mohsinzaheer25 avatar Nov 14 '19 15:11 mohsinzaheer25

So, strangely I solved my issue by making sure my profile was named "Default" in iterm2. This was the only difference between the one mac where it was working and not working. Not sure why the profile name makes a difference as I don't see it in the shuttle.json settings file or anything.

TimothyBramlett avatar Dec 12 '19 18:12 TimothyBramlett

@TimothyBramlett what did you have set as your default profile in iTerm2 when it was not working? (in iTerm2 Preferences=>Profiles and the profile with a star next to the name is the Default)

georgesnow avatar Dec 12 '19 19:12 georgesnow

When it was not working I had named the profile "Tim" and that was the only profile in iTerm.

TimothyBramlett avatar Dec 12 '19 21:12 TimothyBramlett

What variable I need to change in shuttle configuration?

mohsinzaheer25 avatar Dec 12 '19 21:12 mohsinzaheer25

I was having this same issue, and could remedy with the same change from "tab" to "current" for the "inTerminal" variable in Shuttle as @mohsinzaheer25 (thanks for kicking things off here!).

But I like using the "tab" feature as I'll often have multiple hosts open, so I decided to play around with iTerm.

I found that if I switched iTerm's "Window restoration policy" from its default "Use System Window Restoration Setting" to "Only Restore Hotkey Window" (see screenshot below), then the "tab" setting in Shuttle works fine.

This leads me to believe the issue has more to do with the way that the OS is handling the shell, rather than anything to do with Shuttle.

Obviously it would be nice if the default settings work out of the box with no special config required... maybe someone can suggest a system config edit that would resolve this?

image

micahmount avatar Feb 21 '20 17:02 micahmount

I managed to fix it by following way (Dark is my ITerm2 profile name):

  "terminal": "iTerm.app",
  "iTerm_version": "stable",
  "default_theme": "Dark",

szakha92 avatar Feb 28 '23 14:02 szakha92