Codeman maintainer
7936a75e28
feat(terminal): Auto Copy, put a finished selection on the clipboard
...
App Settings > Terminal & Input > Selection & clipboard > Auto Copy
Selection (`autoCopySelection`, per-device, default OFF). With it on,
highlighting text in the terminal copies it: mouse drag, double-click
word, triple-click line, and the phone long-press selection. Ctrl+C is
untouched and still copies on demand.
Three things decide the shape of it:
* It fires at the END of a gesture, never in onSelectionChange. That
callback runs for every cell a drag crosses, so copying there would be
one clipboard write per mouse move. It only arms a pending flag; a
document-level mouseup listener flushes, and the touch path calls the
flush itself because it preventDefaults its touchend and no mouseup
ever arrives there.
* The flush is synchronous inside the handler, because both clipboard
paths need user activation: Firefox gates navigator.clipboard
.writeText on it, and execCommand('copy'), the fallback the plain-HTTP
LAN install lands on, has to run in the gesture's own task. A timer or
a wait for onSelectionChange loses it, invisibly in Chrome.
* It deliberately does NOT do what copyTerminalSelection() does. That
one clears the selection (so a second Ctrl+C is an interrupt) and
focuses the terminal. Clearing would make text vanish under the cursor
that just highlighted it, and focusing opens the on-screen keyboard
over it on a phone. Focus is instead restored to whatever held it,
which only matters for the execCommand fallback.
Guards are pure in decideAutoCopy() (constants.js): off, blank or
whitespace-only text, and a 1M-char cap, since a drag off the top of the
viewport autoscrolls and one gesture can sweep the whole 50k-line
scrollback. Past the cap the copy is refused rather than truncated, with
a toast pointing at Ctrl+C.
Feedback is silent on success except once per page load, so a feature
that works by doing nothing visible can still be told from a dead
toggle; failures and refusals toast, throttled to 10s.
Per-device on both counts the settings rule requires: in `displayKeys`
and absent from the .strict() SettingsUpdateSchema, because clipboard
access differs by device and by origin.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-08-20 10:46:11 +02:00
..
2026-06-08 15:41:46 +02:00
2026-08-14 00:00:59 +02:00
2026-08-16 07:05:10 +02:00
2026-08-19 23:33:08 +02:00
2026-08-05 11:11:18 -05:00
2026-06-10 01:38:40 +02:00
2026-07-20 17:35:40 +02:00
2026-08-10 12:29:00 +02:00
2026-08-12 02:30:08 +02:00
2026-08-14 13:40:42 +02:00
2026-08-14 14:46:23 +02:00
2026-08-08 22:30:39 +03:00
2026-08-05 01:40:37 +02:00
2026-01-27 23:15:25 +01:00
2026-06-09 20:02:15 +02:00
2026-08-10 12:29:00 +02:00
2026-08-17 00:46:03 +02:00
2026-07-12 17:50:21 +02:00
2026-06-14 12:46:58 -04:00
2026-06-19 17:58:06 -04:00
2026-06-19 17:58:06 -04:00
2026-02-12 13:44:07 +01:00
2026-03-07 07:33:44 +01:00
2026-02-26 16:44:34 +01:00
2026-08-07 16:41:39 +02:00
2026-08-10 11:19:51 +02:00
2026-07-20 02:48:14 +02:00
2026-08-07 04:06:54 +02:00
2026-03-01 16:50:23 +01:00
2026-06-08 11:01:34 -04:00
2026-08-09 12:09:51 +02:00
2026-06-14 12:46:58 -04:00
2026-08-09 05:02:14 +02:00
2026-06-11 10:16:47 +02:00
2026-06-10 22:47:02 +02:00
2026-07-12 19:06:12 +02:00
2026-07-12 18:42:36 +02:00
2026-08-09 15:56:44 +02:00
2026-08-13 17:23:27 +02:00
2026-06-29 11:35:56 +05:30
2026-08-09 02:22:01 +02:00
2026-03-01 16:50:23 +01:00
2026-08-13 17:41:44 +02:00
2026-06-14 12:25:49 -04:00
2026-08-18 23:24:22 +02:00
2026-07-20 02:36:02 +02:00
2026-07-20 02:36:02 +02:00
2026-07-20 02:36:02 +02:00
2026-06-14 08:43:57 +02:00
2026-06-14 08:43:57 +02:00
2026-06-12 09:09:14 -04:00
2026-07-12 17:50:21 +02:00
2026-07-20 12:33:12 +02:00
2026-06-07 04:33:11 +02:00
2026-08-09 22:39:07 +02:00
2026-08-09 15:45:10 +02:00
2026-08-05 08:44:47 +02:00
2026-06-10 01:30:43 +02:00
2026-08-14 00:14:21 +02:00
2026-08-19 23:35:45 +02:00
2026-06-09 20:02:15 +02:00
2026-08-06 10:16:15 +08:00
2026-06-19 13:10:17 -04:00
2026-07-12 17:50:21 +02:00
2026-08-10 00:07:01 +02:00
2026-07-12 18:06:59 +02:00
2026-08-05 02:38:57 +02:00
2026-08-10 03:15:13 +02:00
2026-08-14 00:00:59 +02:00
2026-08-10 11:16:58 +02:00
2026-08-16 20:21:54 +02:00
2026-08-09 14:04:34 +02:00
2026-08-10 00:29:19 +02:00
2026-08-09 01:18:03 +02:00
2026-08-14 00:14:21 +02:00
2026-07-21 02:49:25 +08:00
2026-06-12 09:09:14 -04:00
2026-08-13 17:20:20 +02:00
2026-07-12 12:42:14 +02:00
2026-08-17 01:46:48 +02:00
2026-06-10 01:30:43 +02:00
2026-08-09 18:03:13 +02:00
2026-08-05 02:38:57 +02:00
2026-08-16 20:34:34 +02:00
2026-08-13 13:54:47 +02:00
2026-03-07 07:33:44 +01:00
2026-06-14 22:21:13 +02:00
2026-08-16 20:34:34 +02:00
2026-02-26 16:44:34 +01:00
2026-08-09 18:34:35 +02:00
2026-08-19 19:14:52 +00:00
2026-08-16 20:21:54 +02:00
2026-08-11 23:14:57 +02:00
2026-08-18 16:20:43 +02:00
2026-07-20 12:33:12 +02:00
2026-02-18 12:51:35 +01:00
2026-08-09 13:23:24 +02:00
2026-06-08 11:01:34 -04:00
2026-07-19 15:32:45 +02:00
2026-02-12 13:44:07 +01:00
2026-08-04 15:02:46 +02:00
2026-07-28 23:20:01 +03:00
2026-02-26 15:58:26 +01:00
2026-06-10 01:30:43 +02:00
2026-03-21 19:23:37 +01:00
2026-03-21 07:20:18 +01:00
2026-07-20 04:02:46 +02:00
2026-08-09 16:16:54 +02:00
2026-08-09 17:32:24 +02:00
2026-06-08 10:27:18 -04:00
2026-02-26 16:44:34 +01:00
2026-08-13 17:23:27 +02:00
2026-08-07 01:34:47 +02:00
2026-02-12 18:26:16 +01:00
2026-06-09 20:02:17 +02:00
2026-08-09 16:03:27 +02:00
2026-07-28 04:15:30 +02:00
2026-08-09 03:30:15 +02:00
2026-01-21 22:36:45 +01:00
2026-06-10 01:30:43 +02:00
2026-02-19 14:00:10 +01:00
2026-01-21 14:01:47 +01:00
2026-06-10 18:06:45 +02:00
2026-03-01 16:50:23 +01:00
2026-08-09 23:05:11 +02:00
2026-08-09 23:05:11 +02:00
2026-08-10 11:15:47 +02:00
2026-08-09 23:05:11 +02:00
2026-06-19 16:58:40 +02:00
2026-07-17 15:59:36 -04:00
2026-07-17 16:03:03 -04:00
2026-08-05 01:40:37 +02:00
2026-07-17 15:54:32 -04:00
2026-07-17 16:03:03 -04:00
2026-08-07 05:05:41 +02:00
2026-08-13 13:54:47 +02:00
2026-03-07 07:33:44 +01:00
2026-02-26 16:44:34 +01:00
2026-06-10 20:41:34 +02:00
2026-03-07 07:33:44 +01:00
2026-03-07 07:33:44 +01:00
2026-08-09 15:31:02 +02:00
2026-07-12 18:21:42 +02:00
2026-01-25 07:52:40 +01:00
2026-08-18 10:59:44 -04:00
2026-03-01 14:33:18 +01:00
2026-02-26 16:44:34 +01:00
2026-08-19 19:14:52 +00:00
2026-08-16 20:34:34 +02:00
2026-07-17 16:26:28 -04:00
2026-08-18 10:46:21 -04:00
2026-08-13 13:54:47 +02:00
2026-06-10 03:41:04 +02:00
2026-02-18 18:14:13 +01:00
2026-08-10 03:15:13 +02:00
2026-06-09 20:02:15 +02:00
2026-06-10 17:08:36 +02:00
2026-08-16 20:34:34 +02:00
2026-08-05 01:53:43 +02:00
2026-08-09 01:34:55 +02:00
2026-08-16 20:32:41 +02:00
2026-07-12 19:49:58 +02:00
2026-06-10 20:41:34 +02:00
2026-06-10 01:30:43 +02:00
2026-08-09 01:18:03 +02:00
2026-08-17 22:54:46 +02:00
2026-08-10 03:15:13 +02:00
2026-08-18 16:20:43 +02:00
2026-08-18 16:26:34 +02:00
2026-07-12 17:50:21 +02:00
2026-06-10 04:07:26 +02:00
2026-08-10 11:43:55 +02:00
2026-07-17 16:21:16 -04:00
2026-08-16 05:11:00 +02:00
2026-07-17 16:25:29 -04:00
2026-06-17 23:41:47 +08:00
2026-08-17 21:42:25 +02:00
2026-02-26 16:44:34 +01:00
2026-08-03 21:22:33 +08:00
2026-08-09 16:01:48 +02:00
2026-08-09 01:18:03 +02:00
2026-08-09 21:32:04 -04:00
2026-06-10 01:30:43 +02:00
2026-07-31 08:47:52 +02:00
2026-08-05 01:40:37 +02:00
2026-08-10 03:59:43 +02:00
2026-07-25 15:28:04 +08:00
2026-08-07 01:31:50 +02:00
2026-06-10 01:30:43 +02:00
2026-08-13 17:28:35 +02:00
2026-06-09 20:02:15 +02:00
2026-08-13 17:28:35 +02:00
2026-06-10 01:30:43 +02:00
2026-03-07 07:33:44 +01:00
2026-07-17 16:26:36 -04:00
2026-08-18 23:24:22 +02:00
2026-01-22 11:30:10 +01:00
2026-05-12 10:11:47 +02:00
2026-06-15 01:43:15 +02:00
2026-08-10 03:06:23 +02:00
2026-02-28 17:39:44 +01:00
2026-02-28 17:39:44 +01:00
2026-01-21 07:19:49 +01:00
2026-02-26 16:44:34 +01:00
2026-06-10 18:06:45 +02:00
2026-08-20 10:46:11 +02:00
2026-07-10 14:39:19 -04:00
2026-08-05 02:38:57 +02:00
2026-08-05 02:38:57 +02:00
2026-08-08 23:00:36 +03:00
2026-08-19 00:45:19 +02:00
2026-06-30 19:52:49 -04:00
2026-07-12 12:39:46 +02:00
2026-06-09 15:39:03 -04:00
2026-08-19 19:41:43 +00:00
2026-02-26 16:44:34 +01:00
2026-08-14 00:51:58 +02:00
2026-08-14 00:00:59 +02:00
2026-08-19 19:41:43 +00:00
2026-08-18 19:55:23 +02:00
2026-06-09 15:39:03 -04:00
2026-07-12 18:33:18 +02:00
2026-08-09 01:18:03 +02:00
2026-07-12 19:49:58 +02:00
2026-07-10 11:14:26 -04:00
2026-05-25 23:28:58 +02:00
2026-08-09 18:03:13 +02:00
2026-07-20 03:26:21 +02:00
2026-06-10 20:41:34 +02:00
2026-06-14 07:33:52 +02:00
2026-07-20 02:58:51 +02:00
2026-01-22 11:30:10 +01:00
2026-08-10 11:19:51 +02:00
2026-07-12 12:42:36 +02:00
2026-07-29 17:50:41 +02:00
2026-07-29 09:01:18 +02:00
2026-08-09 04:06:23 +02:00
2026-07-31 08:47:52 +02:00
2026-06-18 10:00:04 +02:00
2026-07-21 00:04:40 +08:00
2026-07-12 18:42:36 +02:00
2026-07-12 18:42:36 +02:00
2026-07-12 18:42:36 +02:00