Skip to content

Stop duplicating "Press Ctrl+C to exit." in holding messages#379

Merged
umair-ably merged 1 commit intomainfrom
fix-duplicate-press-ctrl-c
Apr 27, 2026
Merged

Stop duplicating "Press Ctrl+C to exit." in holding messages#379
umair-ably merged 1 commit intomainfrom
fix-duplicate-press-ctrl-c

Conversation

@umair-ably
Copy link
Copy Markdown
Collaborator

Summary

  • formatListening (src/utils/output.ts:18) auto-appends "Press Ctrl+C to exit." to the message it gets, and logHolding/logListening (src/base-command.ts) both route through it.
  • Every logHolding call site — and one logListening site in channels/presence/enter — passed a message that already ended with the same phrase, so the rendered output doubled it: Holding presence. Press Ctrl+C to exit. Press Ctrl+C to exit.
  • Stripped the manual suffix from the six affected call sites. The helper still appends it once, and the holding-style sites now match the convention logListening callers already follow elsewhere (e.g. "Listening for messages.").

Test plan

  • pnpm prepare builds clean
  • pnpm exec eslint . — 0 errors
  • pnpm test:unit — 2295 passed, 1 skipped, 1 todo
  • Manual: run ably rooms presence enter chat and confirm the holding line reads Holding presence. Press Ctrl+C to exit. (single suffix)

formatListening (utils/output.ts) auto-appends "Press Ctrl+C to exit."
to whatever description it gets, and logHolding/logListening route
through it. But every logHolding call site — and one logListening
call site in channels/presence/enter — passed a message that already
ended with that suffix, so the rendered text doubled it:

  Holding presence. Press Ctrl+C to exit. Press Ctrl+C to exit.

Strip the manual suffix from each affected call site. The helper still
appends it once. logListening callers elsewhere already follow this
shape (e.g. "Listening for messages." with no manual suffix), so this
just brings the holding-style sites into line with the established
convention.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli-web-cli Ready Ready Preview, Comment Apr 27, 2026 1:14pm

Request Review

@claude-code-ably-assistant
Copy link
Copy Markdown

Walkthrough

formatListening in src/utils/output.ts already appends "Press Ctrl+C to exit." to every message it renders, but six logHolding / logListening call sites were passing that phrase as part of their message string — causing the suffix to appear twice in terminal output (e.g. Holding presence. Press Ctrl+C to exit. Press Ctrl+C to exit.). This PR strips the manual suffix from all six offending sites so the helper appends it exactly once, matching the convention already followed by other logListening callers.

Changes

Area Files Summary
Commands – Channels src/commands/channels/presence/enter.ts Remove duplicate "Press Ctrl+C to exit." from logListening and logHolding call
Commands – Rooms src/commands/rooms/presence/enter.ts Remove duplicate suffix from logHolding call
Commands – Spaces src/commands/spaces/cursors/set.ts Remove suffix from both branches of the simulate/hold ternary passed to logHolding
Commands – Spaces src/commands/spaces/locations/set.ts Remove suffix from logHolding call
Commands – Spaces src/commands/spaces/locks/acquire.ts Remove suffix from logHolding call
Commands – Spaces src/commands/spaces/members/enter.ts Remove suffix from logHolding call

Review Notes

  • Behavioural change (display only): Terminal output for all six commands changes from <message> Press Ctrl+C to exit. Press Ctrl+C to exit. to <message> Press Ctrl+C to exit. — intentional fix, no functional side-effects.
  • No new dependencies.
  • Test coverage: Unit tests pass (2 295 passed). A manual smoke-test of one holding command (e.g. ably rooms presence enter) is recommended to confirm the rendered line looks correct; no automated test currently asserts the exact holding message text.
  • No migration or deployment considerations — pure display fix.

@umair-ably umair-ably requested review from AndyTWF and sacOO7 April 27, 2026 13:15
Copy link
Copy Markdown
Contributor

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@umair-ably umair-ably enabled auto-merge April 27, 2026 13:22
@umair-ably umair-ably merged commit 1d0395d into main Apr 27, 2026
13 checks passed
@umair-ably umair-ably deleted the fix-duplicate-press-ctrl-c branch April 27, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants