Skip to content

Commit 3dc820f

Browse files
committed
fix: truncate CDP WebSocket URL in launch output table
1 parent a8593d6 commit 3dc820f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cmd/claude/launch.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func runLaunch(cmd *cobra.Command, args []string) error {
148148
{"Property", "Value"},
149149
{"Browser ID", browser.SessionID},
150150
{"Live View URL", browser.BrowserLiveViewURL},
151-
{"CDP WebSocket URL", browser.CdpWsURL},
151+
{"CDP WebSocket URL", truncateURL(browser.CdpWsURL, 60)},
152152
{"Timeout (seconds)", fmt.Sprintf("%d", timeout)},
153153
}
154154
if bundle.HasAuthStorage() {
@@ -217,3 +217,11 @@ func waitForBrowserReady(ctx context.Context, client kernel.Client, browserID st
217217

218218
return fmt.Errorf("browser %s not accessible after %d attempts", browserID, maxAttempts)
219219
}
220+
221+
// truncateURL truncates a URL to a maximum length, adding "..." if truncated.
222+
func truncateURL(url string, maxLen int) string {
223+
if len(url) <= maxLen {
224+
return url
225+
}
226+
return url[:maxLen-3] + "..."
227+
}

0 commit comments

Comments
 (0)