fix(tui): fix Linux Ctrl+C regression, remove double clipboard write

- Fix critical regression: on Linux, Ctrl+C could not interrupt/clear/exit
  because isAction(key,'c') shadowed the isCtrl block (both resolve to k.ctrl
  on non-macOS). Restructured: isAction block now falls through to interrupt
  logic on non-macOS when no selection exists.
- Remove double pbcopy: ink's copySelection() already calls setClipboard()
  which handles pbcopy+tmux+OSC52. The extra writeClipboardText call in
  useInputHandlers copySelection() was firing pbcopy a second time.
- Remove allowClipboardHotkeys prop from TextInput — every caller passed
  isMac, and TextInput already imports isMac. Eliminated prop-drilling
  through appLayout, maskedPrompt, and prompts.
- Remove dead code: the isCtrl copy paths (lines 277-288) were unreachable
  on any platform after the isAction block changes.
- Simplify textInput Cmd+C: use writeClipboardText directly without the
  redundant OSC52 fallback (this path is macOS-only where pbcopy works).
This commit is contained in:
kshitijk4poor 2026-04-20 14:15:57 +05:30 committed by kshitij
parent e388910fe6
commit b7e71fb727
5 changed files with 18 additions and 51 deletions

View file

@ -6,7 +6,6 @@ import type { AppLayoutProgressProps, AppLayoutProps } from '../app/interfaces.j
import { $isBlocked } from '../app/overlayStore.js'
import { $uiState } from '../app/uiStore.js'
import { PLACEHOLDER } from '../content/placeholders.js'
import { isMac } from '../lib/platform.js'
import type { Theme } from '../theme.js'
import type { DetailsMode } from '../types.js'
@ -236,7 +235,6 @@ const ComposerPane = memo(function ComposerPane({
<Box flexGrow={1} position="relative">
<TextInput
columns={Math.max(20, composer.cols - pw)}
allowClipboardHotkeys={isMac}
onChange={composer.updateInput}
onPaste={composer.handleTextPaste}
onSubmit={composer.submit}