Files
Netcatty/components
陈大猫 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-01 21:03:43 +08:00
2026-06-06 17:04:33 +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-05-07 12:57:54 +08:00
2026-06-01 21:03:43 +08:00
2026-06-01 21:03:43 +08:00
2026-06-01 21:03:43 +08:00
2026-06-02 12:01:40 +08:00
2026-06-06 22:13:47 +08:00