From e1f6d24655e5e205b6934c69a03bcac918992add Mon Sep 17 00:00:00 2001 From: Lawrence Chen Date: Fri, 13 Mar 2026 07:00:05 -0700 Subject: [PATCH] Harden cmux theme override writes --- CLI/cmux.swift | 5 +++-- ghostty | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CLI/cmux.swift b/CLI/cmux.swift index 29b5608b..cc3b3faa 100644 --- a/CLI/cmux.swift +++ b/CLI/cmux.swift @@ -5996,10 +5996,11 @@ struct CMUXCLI { private func removingManagedThemeOverride(from contents: String) -> String { let pattern = #"(?ms)\n?# cmux themes start\n.*?\n# cmux themes end\n?"# - guard let range = contents.range(of: pattern, options: [.regularExpression]) else { + guard let regex = try? NSRegularExpression(pattern: pattern) else { return contents } - return contents.replacingCharacters(in: range, with: "") + let fullRange = NSRange(contents.startIndex.. ThemeReloadStatus { diff --git a/ghostty b/ghostty index 3ec087ad..80cca8a1 160000 --- a/ghostty +++ b/ghostty @@ -1 +1 @@ -Subproject commit 3ec087ad3481e61df170373c20f07162154abb29 +Subproject commit 80cca8a12ebd554953fc6b35235135a3e61fe20c