-
Notifications
You must be signed in to change notification settings - Fork 936
Write last build tag to /tmp for statusline #2652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -405,6 +405,10 @@ if [[ -n "$TAG" && "$APP_NAME" != "$SEARCH_APP_NAME" ]]; then | |||||||||||||||
| CMUX_DEBUG_LOG="/tmp/cmux-debug-${TAG_SLUG}.log" | ||||||||||||||||
| write_last_socket_path "$CMUX_SOCKET" | ||||||||||||||||
| echo "$CMUX_DEBUG_LOG" > /tmp/cmux-last-debug-log-path || true | ||||||||||||||||
| echo "$TAG" > /tmp/cmux-last-tag || true | ||||||||||||||||
| if [[ -n "${CLAUDE_SESSION_ID:-}" ]]; then | ||||||||||||||||
| echo "$TAG" > "/tmp/cmux-last-tag-${CLAUDE_SESSION_ID}" || true | ||||||||||||||||
| fi | ||||||||||||||||
|
Comment on lines
+409
to
+411
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The script's established pattern is to pass all env-controlled values through
Suggested change
|
||||||||||||||||
| /usr/libexec/PlistBuddy -c "Add :LSEnvironment dict" "$INFO_PLIST" 2>/dev/null || true | ||||||||||||||||
| /usr/libexec/PlistBuddy -c "Set :LSEnvironment:CMUXD_UNIX_PATH \"${CMUXD_SOCKET}\"" "$INFO_PLIST" 2>/dev/null \ | ||||||||||||||||
| || /usr/libexec/PlistBuddy -c "Add :LSEnvironment:CMUXD_UNIX_PATH string \"${CMUXD_SOCKET}\"" "$INFO_PLIST" | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLAUDE_SESSION_IDis written directly into the filename (/tmp/cmux-last-tag-${CLAUDE_SESSION_ID}) without slugging/validation. If the session id ever contains path separators or traversal segments (for examplea/b), the redirection fails or can target an unintended path, and the trailing|| truesuppresses the error so the per-session tag file is silently not updated. This breaks the new statusline behavior for those sessions; normalize the id (e.g., viasanitize_path) before using it in a filesystem path.Useful? React with 👍 / 👎.