From e246c20654989c35ccabc37370472deabaef8151 Mon Sep 17 00:00:00 2001 From: Stefanie Jane Date: Fri, 21 Aug 2026 13:26:22 -0700 Subject: [PATCH 1/2] fix(shell): raise macOS file descriptor capacity GUI terminals inherit launchd's 256-file soft limit, which starves watcher-heavy development stacks such as moon and Next.js. Raise the interactive shell limit within the kernel hard ceiling before tools start. Co-Authored-By: Nova (GPT-5.4) --- sh/env.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sh/env.sh b/sh/env.sh index e1f31cc..a4d3e86 100644 --- a/sh/env.sh +++ b/sh/env.sh @@ -18,6 +18,27 @@ fi # Development tool configurations export USE_CCACHE=1 + +# GUI terminals inherit launchd's tiny 256-file soft limit on macOS. Raise +# the shell limit before starting watcher-heavy tools such as moon and Next.js. +if is_macos; then + _desired_open_files=65536 + _current_open_files="$(ulimit -Sn)" + _hard_open_files="$(ulimit -Hn)" + + if [[ "${_hard_open_files}" != "unlimited" && + "${_hard_open_files}" -lt "${_desired_open_files}" ]]; then + _desired_open_files="${_hard_open_files}" + fi + + if [[ "${_current_open_files}" != "unlimited" && + "${_current_open_files}" -lt "${_desired_open_files}" ]]; then + ulimit -Sn "${_desired_open_files}" 2>/dev/null || true + fi + + unset _desired_open_files _current_open_files _hard_open_files +fi + # Resolve ccache rather than hardcoding /usr/bin/ccache, which does not exist # on Homebrew installs. if has_command ccache; then From 0aa8aa23ed28d17d25d63e24c09eecfa25631954 Mon Sep 17 00:00:00 2001 From: Stefanie Jane Date: Fri, 21 Aug 2026 13:37:28 -0700 Subject: [PATCH 2/2] style(shell): apply canonical redirection spacing Match shellint's formatter output so the macOS file-limit guard remains stable under repository formatting checks. Co-Authored-By: Nova (GPT-5.4) --- sh/env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/env.sh b/sh/env.sh index a4d3e86..2c59cfa 100644 --- a/sh/env.sh +++ b/sh/env.sh @@ -33,7 +33,7 @@ if is_macos; then if [[ "${_current_open_files}" != "unlimited" && "${_current_open_files}" -lt "${_desired_open_files}" ]]; then - ulimit -Sn "${_desired_open_files}" 2>/dev/null || true + ulimit -Sn "${_desired_open_files}" 2> /dev/null || true fi unset _desired_open_files _current_open_files _hard_open_files