From b1cb6048db85e7dbbf0ade93d788ebab1d40da03 Mon Sep 17 00:00:00 2001 From: umair Date: Mon, 27 Apr 2026 14:14:12 +0100 Subject: [PATCH] Stop duplicating "Press Ctrl+C to exit." in holding messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/commands/channels/presence/enter.ts | 7 ++----- src/commands/rooms/presence/enter.ts | 2 +- src/commands/spaces/cursors/set.ts | 4 +--- src/commands/spaces/locations/set.ts | 2 +- src/commands/spaces/locks/acquire.ts | 2 +- src/commands/spaces/members/enter.ts | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/commands/channels/presence/enter.ts b/src/commands/channels/presence/enter.ts index 669a1f229..6a6f5763f 100644 --- a/src/commands/channels/presence/enter.ts +++ b/src/commands/channels/presence/enter.ts @@ -193,12 +193,9 @@ export default class ChannelsPresenceEnter extends AblyBaseCommand { } } if (flags["show-others"]) { - this.logListening( - "Listening for presence events. Press Ctrl+C to exit.", - flags, - ); + this.logListening("Listening for presence events.", flags); } else { - this.logHolding("Holding presence. Press Ctrl+C to exit.", flags); + this.logHolding("Holding presence.", flags); } // Wait until the user interrupts or the optional duration elapses diff --git a/src/commands/rooms/presence/enter.ts b/src/commands/rooms/presence/enter.ts index f8af8dedf..2c2b01e9e 100644 --- a/src/commands/rooms/presence/enter.ts +++ b/src/commands/rooms/presence/enter.ts @@ -197,7 +197,7 @@ export default class RoomsPresenceEnter extends ChatBaseCommand { if (flags["show-others"]) { this.logListening("Listening for presence events.", flags); } else { - this.logHolding("Holding presence. Press Ctrl+C to exit.", flags); + this.logHolding("Holding presence.", flags); } // Wait until the user interrupts or the optional duration elapses diff --git a/src/commands/spaces/cursors/set.ts b/src/commands/spaces/cursors/set.ts index 72339e28a..6e2ac1144 100644 --- a/src/commands/spaces/cursors/set.ts +++ b/src/commands/spaces/cursors/set.ts @@ -273,9 +273,7 @@ export default class SpacesCursorsSet extends SpacesBaseCommand { // Hold in both simulate and non-simulate modes this.logHolding( - flags.simulate - ? "Simulating cursor movement. Press Ctrl+C to exit." - : "Holding cursor. Press Ctrl+C to exit.", + flags.simulate ? "Simulating cursor movement." : "Holding cursor.", flags, ); diff --git a/src/commands/spaces/locations/set.ts b/src/commands/spaces/locations/set.ts index 7968735bd..dec9128fc 100644 --- a/src/commands/spaces/locations/set.ts +++ b/src/commands/spaces/locations/set.ts @@ -70,7 +70,7 @@ export default class SpacesLocationsSet extends SpacesBaseCommand { ); this.log(`${formatLabel("Location")} ${JSON.stringify(location)}`); } - this.logHolding("Holding location. Press Ctrl+C to exit.", flags); + this.logHolding("Holding location.", flags); await this.waitAndTrackCleanup(flags, "location", flags.duration); } catch (error) { diff --git a/src/commands/spaces/locks/acquire.ts b/src/commands/spaces/locks/acquire.ts index 9af351e4f..9e9ea4ed1 100644 --- a/src/commands/spaces/locks/acquire.ts +++ b/src/commands/spaces/locks/acquire.ts @@ -123,7 +123,7 @@ export default class SpacesLocksAcquire extends SpacesBaseCommand { ); this.log(formatLockBlock(lock)); } - this.logHolding("Holding lock. Press Ctrl+C to exit.", flags); + this.logHolding("Holding lock.", flags); } catch (error) { this.fail(error, flags, "lockAcquire", { lockId, diff --git a/src/commands/spaces/members/enter.ts b/src/commands/spaces/members/enter.ts index 9f44a8b66..c142f5d72 100644 --- a/src/commands/spaces/members/enter.ts +++ b/src/commands/spaces/members/enter.ts @@ -86,7 +86,7 @@ export default class SpacesMembersEnter extends SpacesBaseCommand { this.log(`${formatLabel("Profile")} ${JSON.stringify(profileData)}`); } } - this.logHolding("Holding presence. Press Ctrl+C to exit.", flags); + this.logHolding("Holding presence.", flags); // Wait until the user interrupts or the optional duration elapses await this.waitAndTrackCleanup(flags, "member", flags.duration);