0

It seems there is some sort of arbitrary limit in place for the number of iTerm2 windows I can have open on my Mac at one time. I can open up to 6 instances normally, but the 7th instance always closes with the following message: enter image description here
I can't seem to find any answers on why this might be or how I can increase the limit on terminal instances. My RAM usage is well below the limit with only 6 of these running. I like to have multiple spaces set up that I can swap between and this issue is hindering me once I have a couple of workspaces created for different tasks. Is there a way I can get around this? I can open 7+ instances of my browser so this seems to be iTerm2 specific.

2
  • 1
    Not an answer, but I just opened 12 iTerm windows with no issues. I've a Mac Studio M1 Max with 64GB ram. I know of no iTerm setting that limits the number of active windows. I hope you get it sorted.
    – SteveM
    Commented Dec 19, 2023 at 20:48
  • A web search with that precise error message shows results for Terminal as well as iTerm2. Related to shell settings. Like @SteveM I get to 12 windows without issue.
    – Gilby
    Commented Dec 19, 2023 at 22:21

1 Answer 1

1

I had the same problem. I couldn't open more than 6 windows of iTerm2.

I didn't fix the exact problem, but I found a workaround.

There is a difference between open a new instance:

  • from inside iTerm execute open -n -a iTerm
    • In this case you'll see more icons in the dock, one for each instance and open a new window:
  • click w two fingers on the iTerm2 icon and select "New Window (Default Profile)"
    • In this case you'll see only one icon in the dock, but you can open more windows.

I was using the first one, with a shortcut, and I wasn't able to open more than 6 windows.

But then I changed the shortcut to execute this:

osascript /[you_path]/new_window_iTerm.scpt

# new_window_iTerm.scpt
tell application "System Events"
    set isRunning to (count of (every process whose name is "iTerm2")) > 0
end tell
if isRunning then
    tell application "iTerm"
      set newWindow to (create window with default profile)
    end tell
else
    tell application "iTerm"
      launch
    end tell
end if

Now I can open more than 6 windows. I hope this helps you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .