Repository navigation
Conversation
On Windows and Linux a bare Ctrl+C now copies the selection and clears it, and stays ^C when nothing is selected. Ctrl+V pastes through the webview's native paste, so bracketed paste and chunking still apply. A Terminal setting, on by default, turns both off to send ^C and ^V to the remote again. Ctrl+Shift+C/V are unchanged and macOS is untouched.
|
Thanks for the PR, the code is clean. We're keeping plain Ctrl+C and Ctrl+V for the shell, since vim, nano, emacs and readline rely on them, and Ctrl+Shift+C/V (or Ctrl+Insert/Shift+Insert) already copy and paste, so I'm closing this one. |
@timhartmann7 If the code is clean, could this function be hidden behind an option that defaults to off? |
Summary
In the desktop terminal on Windows and Linux, copying needed Ctrl+Shift+C or the webview's right-click menu. This makes the plain keys work, as in Windows Terminal:
terminal_writechunking are unchanged, and no clipboard plugin or new capability is needed.terminal_pastecommand, like Ctrl+Shift+V already does.The TUI is untouched: there, copy and paste belong to the host terminal, whose paste already arrives as bracketed paste.
Changes
ui/src/lib/screens/terminalInput.ts:isBareCopy/isBarePastenext toisCopyShortcut, sharing one chord matcher (same keydown, IME and non-Latin rules).ui/src/lib/screens/TerminalView.svelte: handle the bare chords in the custom key handler when the pref is on.ui/src/lib/stores/terminalClipboard.ts: the new pref, shaped likestreamer.ts; hydrated in+layout.svelte.ui/src/lib/screens/Settings.svelte: the Terminal switch.CHANGELOG.md: entry under## Unreleased.Test plan
npm run check: 0 errors, 0 warningsnpm test: the newterminalInputandterminalClipboardsuites pass.select.test.tsfails on Windows before and after this change (path separators), unrelated.npx playwright test e2e/terminal.spec.ts --workers=1: the new and updated clipboard tests pass. The existing "host-first … then close" test fails locally onmaintoo, unrelated.cargo tauri dev: select + Ctrl+C copies; Ctrl+C with no selection interruptssleep; Ctrl+V pastes in bash and in vim; with the setting off, Ctrl+V enters visual-block in vim.