Suggest safe command-not-found corrections in the composer - #239
Open
raiseCatError wants to merge 1 commit into
Open
raiseCatError wants to merge 1 commit into
raiseCatError wants to merge 1 commit into
Conversation
This was referenced Sep 30, 2026
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.
After a simple command fails with exit 127 and a matching command-not-found diagnostic, NMSh may show one deterministic local executable correction. Tab edits the composer; a separate Enter is required to execute. Escape dismisses. Correction rows live only in ScreenPlan's suggestion region, outside PTY output, transcripts, /copy and command history.
Matching requires one unambiguous edit in bounded cached PATH listings. Short-word substitutions, multiple nearby executables, known commands returning 127, complex syntax, quoted/multiline/private input and destructive targets are suppressed. Candidate files must be executable; no commands are run to discover corrections. Dynamic live aliases/functions and subcommand/flag inference are deferred because the current metadata cannot establish reliable authority.
Also guard completion acceptance against buffer/cwd changes within a multi-key input batch, before the next renderer frame.
Dependency: #238; merge after it. Refs #152, #141.
Validation: build, typecheck, git diff --check and full suite (710 passed). Focused tests cover matching, aggressive suppression, stale ABA requests, insert-only keyboard behavior, no transcript mutation, narrow widths, Safe glyphs and NO_COLOR. An initial matching test exposed a too-permissive ambiguity decision; tightened it. An initial full run exposed colored shared help after runtime NO_COLOR change; corrected presentation and verified the final head. Node 22/26 cumulative CI dispatched separately. Physical terminal QA remains pending. Filesystem discovery uses the frontend PATH and excludes relative directories; it does not claim parity with subsequent live-shell PATH changes.