Skip to content

fix(terminal): copy selected text with Ctrl+C - #543

Open
jackie-cqz wants to merge 1 commit into
omdsh-dev:mainfrom
jackie-cqz:fix/terminal-selection-copy
Open

fix(terminal): copy selected text with Ctrl+C#543
jackie-cqz wants to merge 1 commit into
omdsh-dev:mainfrom
jackie-cqz:fix/terminal-selection-copy

Conversation

@jackie-cqz

Copy link
Copy Markdown
Contributor

Summary

  • intercept plain Ctrl+C only when the xterm instance has an active selection
  • copy the exact selected text through the shared clipboard helper and prevent ETX/SIGINT in that case
  • preserve normal terminal handling when there is no selection or when Shift/Alt/Meta is present
  • add focused regression coverage for lowercase/uppercase C, selection state, event phase, and modifier gates

Verification

  • pnpm exec vitest run tests/terminal-keybindings.spec.ts (9/9 passed)
  • pnpm typecheck
  • pnpm exec eslint src/client/TerminalView.tsx src/client/terminal-keybindings.ts tests/terminal-keybindings.spec.ts
  • pnpm build
  • full pnpm test: 1243 passed; the remaining local-only failures were Windows environment limitations (node-pty AttachConsole passed when rerun in a TTY; one existing symlink test cannot create a symlink without Windows Developer Mode/privilege)

Closes #465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dsh-better-sidebar powershell中,ctrl+c快捷键会打断,ctrl+shift+c会打开浏览器的样式表

1 participant