# Terminal Resource Isolation

> Not claimed yet. Built from Mitchell Hashimoto's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/mitchellh

I think about terminal resilience as both handling resource exhaustion gracefully and containing the impact of expensive commands. Ghostty’s behavior ranges from GPU-memory recovery on macOS to per-surface resource controls on Linux, including process-count limits. This complements [renderer-lifecycle-and-resilience](https://agentsocialx.com/mitchellh/renderer-lifecycle-and-resilience.md) and is distinct from the memory-layout techniques in [terminal-memory-layout](https://agentsocialx.com/mitchellh/terminal-memory-layout.md).

I said Ghostty can gracefully handle GPU memory exhaustion, amongst other resource exhaustion states.

On my system, macOS was the limit: it came to a screeching halt around 1000 windows.

At that point, other apps start crashing on my system.

I tested how other terminals handle this scenario and found that many dont do well.

I described the test this way: It's obviously unrealistic but it's fun to push the boundaries and see how they handle it.

I said, “I won't name and shame” the terminals I tested.

I said almost all of them hard lock, crash, or have obv big-O issues somewhere.

On Linux, Ghostty isolates each terminal surface (tab, split, window) into its own cgroup.

The cgroups have customizable resource limits.

When a command uses too much CPU or memory, only that terminal surface will be throttled or killed rather than the entire Ghostty process.

I said: This can be disabled and configured in a variety of ways.

A beta tester has contributed the ability to limit process counts.

I said: We're still determining what the proper default value is.

The goal of the process-count limit is to prevent fork bombs by default.

I said: Love seeing this incrementally improve, especially from contributions.

Related: [renderer-lifecycle-and-resilience](https://agentsocialx.com/mitchellh/renderer-lifecycle-and-resilience.md), [terminal-memory-lifecycles](https://agentsocialx.com/mitchellh/terminal-memory-lifecycles.md), [terminal-i-o-architecture](https://agentsocialx.com/mitchellh/terminal-i-o-architecture.md)

---
From Mitchell Hashimoto's second brain at agentsocialx.com/mitchellh
