You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Temporarily disable the caller's local terminal ECHO while a PTY-backed child runs so typed passwords are not visible on the host terminal. Adds makeRaw/restoreTerminal hooks and OS-specific setEcho implementations (Linux/BSD) and uses them in the PTY startup path. Includes unit tests (TestExecute_SetsHostTerminalRaw and PTY simulation) and updates docs, release notes, changelog, and the version bump to v1.2.7. Also includes small lint/quality fixes referenced in the changelog.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,16 @@
3
3
4
4
All notable changes to this project will be documented in this file.
5
5
6
+
## v1.2.7 - 2026-02-19
7
+
8
+
-**Bugfix (Executor/TUI):** Prevent passwords from being visible when running interactive commands (e.g., `sudo`). When the executor runs a child in hybrid PTY mode we now temporarily disable *local echo* on the caller's terminal so typed passwords are not echoed back to the host terminal. Only the local ECHO flag is toggled (other terminal output processing is preserved) to avoid changing how child output is rendered.
9
+
- Added `makeRaw`/`restoreTerminal` hooks and OS-specific `setEcho` helpers to safely toggle host echo and make the behavior testable.
10
+
- Added `TestExecute_SetsHostTerminalRaw` and PTY-simulation helpers to prevent regressions.
11
+
-**Quality:** Fixed revive lint warnings and kept `gocyclo` under the configured threshold; all `golangci-lint`, `gocyclo`, and unit tests pass locally.
12
+
-**Docs:** Updated `docs/executor.md` and `docs/tui.md` to document the host-terminal echo behavior during interactive PTY-backed runs.
13
+
-**Version:** Bump to `v1.2.7`.
14
+
15
+
6
16
## v1.2.6 - 2026-02-17
7
17
8
18
-**Bugfix (Registry):** Fix rollback creating duplicate version entries — rolling back to a previous version was producing both an "update" and a "rollback" version record because `ApplyVersionByName` called `ReplaceCommands` (which records an "update") and then separately recorded a "rollback". Now uses a single transaction with `replaceCommandsTx` + `recordVersionTx` so only one "rollback" version is created.
This patch prevents passwords from being visible when running interactive commands (for example `sudo`) via `krnr` or the TUI by disabling local echo on the host terminal while a PTY-backed child is running.
4
+
5
+
## Bug fixes
6
+
7
+
### Hide password input during interactive runs
8
+
Interactive programs (such as `sudo`) already read from the child's PTY, but the host terminal could locally echo typed keystrokes — which made passwords visible to observers of the host terminal.
9
+
10
+
**Fix:** temporarily disable the host terminal's ECHO flag while the PTY-backed child runs and restore the previous terminal state afterwards. The change only toggles local echo (preserves output post-processing) to avoid affecting child output rendering.
11
+
12
+
## Tests & docs
13
+
- Unit tests added to validate host-terminal echo toggling in PTY scenarios.
14
+
- Documentation updated to mention the behavior in `docs/executor.md` and `docs/tui.md`.
15
+
16
+
## Upgrade notes
17
+
No DB or user-facing CLI changes required — upgrade to v1.2.7 to get the fix.
This patch fixes an issue where passwords typed into interactive child processes (for example `sudo`) could be visible in the host terminal when running commands via `krnr`/TUI.
4
+
5
+
## Bug fixes
6
+
7
+
### Prevent passwords from being echoed locally
8
+
When the executor runs a child in hybrid PTY mode the child already has a proper `/dev/tty`, but the host terminal could still echo typed characters locally — causing passwords to be visible to someone watching the host terminal.
9
+
10
+
**Fix:** while a PTY-backed child runs we temporarily disable *local echo* on the caller's terminal and restore the prior terminal state afterward. Only the local ECHO flag is toggled so output post-processing and rendering remain unchanged (no more visual glitches).
11
+
12
+
**Tests:** added unit tests that simulate terminal-like stdin and verify host-terminal echo toggling.
13
+
14
+
## Tests & Quality
15
+
- Added `TestExecute_SetsHostTerminalRaw` and supporting test hooks for terminal-mode behavior.
16
+
- Addressed small linter/test hygiene issues; `golangci-lint`, `gocyclo`, and unit tests pass locally.
17
+
18
+
## Docs
19
+
- Updated `docs/executor.md` and `docs/tui.md` to document the host-terminal echo behavior during interactive runs.
20
+
21
+
## Upgrade notes
22
+
- No DB schema changes. Users should simply upgrade to v1.2.7.
Copy file name to clipboardExpand all lines: docs/tui.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ Sanitizing run output
55
55
Interactive commands & hybrid PTY
56
56
- The TUI supports running interactive commands that require user input (e.g., `sudo` password prompts, `pacman` confirmations). When a run is in progress, typed keys are forwarded to the process stdin.
57
57
- The executor uses a **hybrid PTY** approach: stdin and the controlling terminal use a PTY so programs that read from `/dev/tty` work, while stdout/stderr remain as pipes for viewport-friendly output.
58
+
- While a PTY-backed child runs, the host terminal's local echo is temporarily disabled so password input is not visible to observers of the host terminal; the TUI forwards keystrokes into the process while preserving how output renders in the viewport.
58
59
- All prompts and output appear inside the **run output panel** (viewport), not in the footer or bottom bar.
59
60
- Output streams live — no keypress required to see results.
0 commit comments