Fix Pure prompt duplication in Ghostty zsh integration - #1316
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds an opt-in bundled Ghostty Zsh integration (build copies a CMUX_GHOSTTY_ZSH_SRC into shell-integration), updates Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
095a571 to
e051331
Compare
There was a problem hiding this comment.
2 issues found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/probe-pure-prompt-duplication.py">
<violation number="1" location="scripts/probe-pure-prompt-duplication.py:131">
P2: Workspace restoration is not guaranteed on early failures because the readiness loop runs outside the cleanup `try/finally`.</violation>
</file>
<file name="scripts/launch-tagged-automation.sh">
<violation number="1" location="scripts/launch-tagged-automation.sh:20">
P2: `sanitize_bundle` over-escapes dot trimming regexes, so invalid dot-only bundle suffixes can be produced.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| probe_text = "" | ||
|
|
||
| start = time.time() | ||
| while True: |
There was a problem hiding this comment.
P2: Workspace restoration is not guaranteed on early failures because the readiness loop runs outside the cleanup try/finally.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/probe-pure-prompt-duplication.py, line 131:
<comment>Workspace restoration is not guaranteed on early failures because the readiness loop runs outside the cleanup `try/finally`.</comment>
<file context>
@@ -0,0 +1,207 @@
+ probe_text = ""
+
+ start = time.time()
+ while True:
+ try:
+ listed = client._call("surface.list", {"workspace_id": workspace_id}) or {}
</file context>
| sanitize_bundle() { | ||
| local raw="$1" | ||
| local cleaned | ||
| cleaned="$(echo "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/./g; s/^\\.+//; s/\\.+$//; s/\\.+/./g')" |
There was a problem hiding this comment.
P2: sanitize_bundle over-escapes dot trimming regexes, so invalid dot-only bundle suffixes can be produced.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/launch-tagged-automation.sh, line 20:
<comment>`sanitize_bundle` over-escapes dot trimming regexes, so invalid dot-only bundle suffixes can be produced.</comment>
<file context>
@@ -0,0 +1,189 @@
+sanitize_bundle() {
+ local raw="$1"
+ local cleaned
+ cleaned="$(echo "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/./g; s/^\\.+//; s/\\.+$//; s/\\.+/./g')"
+ if [[ -z "$cleaned" ]]; then
+ cleaned="agent"
</file context>
| cleaned="$(echo "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/./g; s/^\\.+//; s/\\.+$//; s/\\.+/./g')" | |
| cleaned="$(echo "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/./g; s/^\.+//; s/\.+$//; s/\.+/./g')" |
Summary
\n%{\r%}under the Ghostty zsh integrationOSC 133;P;k=scontinuation marker after Pure's hidden carriage return, which was creating a second prompt boundary during redrawsdocs/ghostty-fork.mdTesting
ssh cmux-macmini "cd /Users/cmux/fun/cmuxterm-hq/worktrees/task-theo-pure-prompt-duplication && python3 tests/test_ghostty_zsh_pure_hidden_cr_omits_continuation_marker.py"ssh cmux-macmini "cd /Users/cmux/fun/cmuxterm-hq/worktrees/task-theo-pure-prompt-duplication && python3 tests/test_ghostty_zsh_pure_preprompt_redraw.py"ssh cmux-macmini "cd /Users/cmux/fun/cmuxterm-hq/worktrees/task-theo-pure-prompt-duplication && python3 tests/test_ghostty_zsh_prompt_redraw_uses_prompt_start.py"./scripts/reload.sh --tag theo-pure-fixIssues
/Users/lawrencechen/Library/Messages/Attachments/ee/14/F8F69012-5FF5-4D02-A528-E132B13F9CE8/debug-cmux-bundle.zipSummary by cubic
Fix Pure-style zsh prompt duplication in
ghosttyby removing the extra continuation marker after Pure’s hidden carriage return. Bundles and prefers the patched Ghostty zsh integration so tagged builds load the fix; adds small tools to launch tagged apps and probe duplication.Bug Fixes
OSC 133;P;k=safter Pure’s hidden\rin\n%{\r%}prompts.New Features
ghosttysubproject and bundleghostty-integration.zshinto app resources;.zshenvnow prefersCMUX_SHELL_INTEGRATION_DIRoverGHOSTTY_RESOURCES_DIR(with a regression test).scripts/launch-tagged-automation.shandscripts/probe-pure-prompt-duplication.pyfor tagged-app automation and prompt-duplication checks.Written for commit e051331. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores