Repository navigation
Preserve leading-space command history privacy (#990) - #998
Merged
Merged
Conversation
A leading space now keeps a command out of Pebrel's suggestion history, both in memory and in pebrel_history*.jsonl. This matches bash with HISTCONTROL=ignorespace and zsh with HIST_IGNORE_SPACE, and gives you a way to run a command with a secret argument without saving it to disk. NebulaHistory::record owns the rule. The GPUI and legacy Enter paths used to trim the line before recording it, so they now pass the raw line and keep the trimmed copy for the tab icon and environment tracking. The PSReadLine report already passed the raw line. Refs #988
A CMD prompt such as `$P$G ` puts a space between `>` and the input. Without an OSC 133;B boundary, the CMD fallback in prompt_line_snapshot kept that space, so every command looked like a leading-space opt-out and history stopped for that session. Strip one space after `>`, as the arrow prompt branch already does. Pebrel-launched cmd emits the boundary, so this affects nested or foreign cmd sessions only. Refs #988
Without an OSC 133;B boundary, the CMD fallback dropped any space after `>`. With a plain `C:\work>` prompt, ` echo private` lost its space and went into history. Drop the space only when the rest of the line matches the keystroke mirror exactly, which identifies a `$P$G ` separator. Recall, completion and cursor edits keep the space, so history skips the line. The grid test covers a prompt with and without a trailing separator, each with ordinary input, a typed leading space, and history recall.
Kuddev
changed the base branch from
review/nonui-runtime-token-989-20261116
to
main
November 16, 2026 11:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrate #990 so commands beginning with an ASCII space stay out of Pebrel command history. Enter handling preserves the raw command through the shared history gate, while activity bookkeeping still receives normalized text. CMD capture removes a prompt separator only when the typed mirror identifies it, keeping ambiguous recall out of history.
The original PR head remains in the ancestry. This branch only adapts the new regression imports to the renamed terminal crate and records the capture/history contract.
Validation: architecture against the Runtime-token prerequisite, formatting and whitespace checks passed. The existing history, native-confirmation, Enter and CMD regressions are retained for native CI on this head.