Skip to content

Suggest safe command-not-found corrections in the composer - #239

Open
raiseCatError wants to merge 1 commit into
feature/147-directory-navigationfrom
feature/152-safe-command-corrections
Open

raiseCatError wants to merge 1 commit into
feature/147-directory-navigationfrom
feature/152-safe-command-corrections

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant