陈大猫
3be3c14912
fix(terminal): simplify sudo password autofill, scoped to real sudo prompts ( #1281 )
...
Replace the command-rewriting scheme (inject sudo -p marker, sanitize the echo, Ctrl-U retype) with passive observation: arm a short window on a sudo command and fill the password when a real sudo prompt appears.
- Fixes the Ubuntu/PAM no-fill, the cursor jump below the prompt, and the typed-vs-autocomplete discrepancy from #1281 .
- Detection requires the [sudo] tag, or a whole-line bare "Password:" / "密码:"; prefixed prompts (mysql -p "Enter password:", ssh "x@h's password:", psql "Password for user x:") are rejected so the sudo password can't leak to a child program when sudo's creds are warm.
- Disarms when a non-sudo command follows, so a stale window can't fill a later prompt.
Implementation: 322 -> ~140 lines.
2026-06-07 03:11:25 +08:00
..
2026-06-06 18:59:48 +08:00
2026-06-04 17:11:02 +08:00
2026-06-03 16:26:33 +08:00
2026-05-12 20:14:24 +08:00
2026-06-01 21:03:43 +08:00
2026-06-05 15:59:21 +08:00
2026-06-01 23:13:31 +08:00
2026-05-18 20:00:10 +08:00
2026-06-06 17:04:33 +08:00
2026-06-05 03:56:13 +00:00
2026-06-01 23:05:56 +08:00
2026-04-16 22:43:19 +08:00
2026-06-07 03:11:25 +08:00
2026-06-06 20:47:16 +08:00
2026-06-06 22:13:47 +08:00
2026-06-02 01:15:36 +08:00
2026-06-02 01:28:39 +08:00
2026-04-22 01:19:33 +08:00
2026-05-28 15:12:19 +08:00
2026-05-28 15:12:19 +08:00
2026-06-06 18:59:48 +08:00
2026-05-28 15:12:19 +08:00
2026-06-04 17:11:02 +08:00
2026-04-21 22:16:49 +08:00
2026-06-01 17:07:07 +08:00
2026-06-06 22:52:35 +08:00
2026-06-06 22:52:35 +08:00
2026-05-12 20:14:24 +08:00
2026-04-12 17:11:50 +08:00
2026-06-03 10:24:44 +08:00
2026-05-18 20:00:10 +08:00
2026-06-05 15:35:21 +08:00
2026-06-05 06:03:45 +00:00
2026-06-05 06:03:45 +00:00
2026-06-06 20:47:16 +08:00
2026-06-05 02:15:50 +00:00
2026-06-05 15:35:21 +08:00
2026-06-05 15:35:21 +08:00
2026-05-07 12:57:54 +08:00
2026-05-31 15:39:26 +08:00
2026-04-05 14:39:39 +08:00
2026-05-28 15:12:19 +08:00
2026-05-28 15:12:19 +08:00
2026-06-01 23:13:31 +08:00
2026-06-01 21:03:43 +08:00
2026-05-12 20:14:24 +08:00
2026-05-07 17:38:17 +08:00
2026-06-01 21:03:43 +08:00
2026-06-03 01:45:29 +08:00
2026-06-05 15:59:21 +08:00
2026-06-05 15:35:21 +08:00
2026-06-05 15:59:21 +08:00
2026-06-02 01:07:04 +08:00
2026-03-23 23:13:58 +08:00
2026-05-12 20:14:24 +08:00
2026-05-31 18:01:43 +08:00
2026-05-31 15:39:26 +08:00
2026-05-12 20:14:24 +08:00
2026-05-31 15:39:26 +08:00
2026-04-22 01:16:38 +08:00
2026-06-06 17:04:33 +08:00
2026-06-04 23:08:32 +08:00
2026-05-09 17:47:45 +08:00
2026-06-05 03:04:30 +00:00
2026-05-18 11:31:50 +08:00
2026-05-18 11:31:50 +08:00
2026-05-31 18:01:43 +08:00
2026-05-28 15:12:19 +08:00
2026-06-01 21:03:43 +08:00
2026-05-28 15:12:19 +08:00
2026-06-01 23:05:56 +08:00
2026-05-12 20:14:24 +08:00
2026-06-07 03:11:25 +08:00
2026-06-04 23:44:27 +08:00
2026-06-02 12:01:40 +08:00
2026-06-06 20:47:16 +08:00
2026-06-02 12:01:40 +08:00
2026-05-18 22:19:54 +08:00
2026-05-18 22:19:54 +08:00
2026-05-18 22:19:54 +08:00
2026-05-18 22:19:54 +08:00
2026-05-01 16:31:58 +08:00
2026-05-18 20:00:10 +08:00
2026-05-25 22:20:45 +08:00
2026-04-08 16:42:32 +08:00
2026-06-06 22:13:47 +08:00
2026-05-18 20:00:10 +08:00
2026-05-12 20:14:24 +08:00
2026-05-06 15:20:23 +08:00
2026-05-20 10:53:20 +08:00
2026-06-06 22:52:35 +08:00