Skip to content

fix(tui): restore macOS Terminal copy behavior#17131

Merged
OutThisLife merged 1 commit into
mainfrom
fix/macos-cmd-c-copy
Apr 28, 2026
Merged

fix(tui): restore macOS Terminal copy behavior#17131
OutThisLife merged 1 commit into
mainfrom
fix/macos-cmd-c-copy

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore the default TUI theme palette to the original classic/base CLI banner colors (, , , ) instead of hardcoding the banner away from theme inheritance
  • Keep banner/logo/caduceus art inheriting the active theme palette, so custom skins still recolor banner art correctly
  • Add copy-on-select for TUI mouse selections so macOS Terminal.app users can copy text selected while mouse tracking is enabled
  • Keep selection highlight visible after auto-copy and expose selection mutation versioning so copy runs after drag release
  • Add Cmd+C forwarding support for IDE terminals via /terminal-setup, plus parser/platform tests

Test Plan

  • cd ui-tui && npm run type-check
  • cd ui-tui && npm run test -- src/tests/terminalSetup.test.ts src/tests/platform.test.ts packages/hermes-ink/src/ink/events/cmd-shortcuts.test.ts src/tests/theme.test.ts
  • cd ui-tui && npm run build

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 28, 2026
@OutThisLife OutThisLife requested a review from Copilot April 28, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Restores “classic” banner colors and improves copy behavior in fullscreen TUI mode—especially for macOS Terminal.app where Cmd+C isn’t forwarded under mouse tracking—while adding IDE-terminal keybinding setup to forward a Cmd+C copy sequence.

Changes:

  • Switch banner/logo rendering to fixed hex colors (no longer derived from the active theme palette).
  • Add copy-on-select behavior (copy without clearing highlight) and expose selection mutation versioning for “copy after drag release”.
  • Add /terminal-setup support for forwarding Cmd+C via a CSI-u sequence, plus accompanying tests.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ui-tui/src/types/hermes-ink.d.ts Extends useSelection() typing with version() to support selection mutation tracking.
ui-tui/src/lib/terminalSetup.ts Adds a VS Code-like terminal keybinding to forward Cmd+C as a CSI-u sequence when text is selected.
ui-tui/src/lib/platform.ts Updates copy-shortcut detection to accept the forwarded CSI-u Cmd+C shape on macOS.
ui-tui/src/components/branding.tsx Uses fixed banner colors and updates banner art calls to new logo/caduceus signatures.
ui-tui/src/banner.ts Replaces theme-driven gradients with fixed color palettes; updates logo/caduceus signatures accordingly.
ui-tui/src/app/useMainApp.ts Implements copy-on-select using selection subscription/versioning to trigger copy after drag release.
ui-tui/src/app/interfaces.ts Extends SelectionApi with copySelectionNoClear() and version().
ui-tui/src/tests/terminalSetup.test.ts Adds assertions/fixtures for the new Cmd+C forwarding binding and sequence.
ui-tui/src/tests/platform.test.ts Adds coverage for recognizing forwarded Cmd+C on macOS.
ui-tui/packages/hermes-ink/src/ink/ink.tsx Adds selectionVersion and makes selection subscribers fire on every selection mutation.
ui-tui/packages/hermes-ink/src/ink/hooks/use-selection.ts Exposes version() from Ink instance through the useSelection() hook.
ui-tui/packages/hermes-ink/src/ink/events/cmd-shortcuts.test.ts Adds parser coverage for the forwarded Cmd+C CSI-u sequence (ctrl+super+c).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/app/useMainApp.ts Outdated
Comment thread ui-tui/packages/hermes-ink/src/ink/ink.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

ui-tui/packages/hermes-ink/src/ink/ink.tsx:1672

  • The docstring for subscribeToSelectionChange says it fires when the selection is “copied”, but copySelectionNoClear() does not call notifySelectionChange() (and shouldn’t, to avoid feedback loops with version-based subscribers). Consider updating this comment to reflect the actual notification semantics (mutations/clear), so consumers don’t rely on a copy notification that won’t arrive.
  /**
   * Subscribe to selection state changes. Fires whenever the selection
   * is started, updated, cleared, or copied. Returns an unsubscribe fn.
   */

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/lib/terminalSetup.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/packages/hermes-ink/src/ink/ink.tsx
Comment thread ui-tui/src/__tests__/forceTruecolor.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/lib/terminalSetup.ts Outdated
@OutThisLife OutThisLife force-pushed the fix/macos-cmd-c-copy branch from a0e4d64 to 9c34623 Compare April 28, 2026 21:31
@OutThisLife OutThisLife requested a review from Copilot April 28, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/lib/terminalSetup.ts Outdated
Comment thread ui-tui/packages/hermes-ink/src/ink/ink.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui-tui/src/lib/forceTruecolor.ts Outdated
Comment thread ui-tui/src/theme.ts Outdated
Comment thread ui-tui/src/lib/terminalSetup.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
@OutThisLife OutThisLife force-pushed the fix/macos-cmd-c-copy branch from 41a4444 to 86a4367 Compare April 28, 2026 23:46
@OutThisLife OutThisLife merged commit 6b09df3 into main Apr 28, 2026
12 of 13 checks passed
@OutThisLife OutThisLife deleted the fix/macos-cmd-c-copy branch April 28, 2026 23:47
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
Seven74AI pushed a commit to Seven74AI/hermes-agent that referenced this pull request Jun 13, 2026
…17131)

This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions:

- copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled
- copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus
- keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation
- force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app
- move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing
- render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants