Repository navigation
/view: o opens the file shown in your own editor, at the line on screen (#366) - #434
Merged
Merged
Conversation
#366 asked for clearer paths between the native viewer and the editors people already use. /view could hand a file only to the native /edit (e), and its own notes for a partly shown or undecodable file said "less or an editor" without a way to get there. - In /view of a file, o sends the file and the first line on screen to the same bridge /open uses (resolveHostActions): Zed or VS Code opens beside NMSh with argv and the viewer stays; a terminal editor from $VISUAL/$EDITOR gets its command, quoted for the session's shell, placed in the composer for the person to run, never run for them, and the viewer closes so it is in view. A draft already in the composer is never replaced: the viewer says so instead. With no editor known, the viewer shows the bridge's reason. - Rendered Markdown rows are not source lines, so the file then opens at its start; the source view (m) keeps the line. Stored output is not a file and offers nothing new. - The truncation notes and the UTF-16 refusal name this way to the rest; Ask's /view description lists e and o. Tests drive the real key handler and the real bridge with a fake host: terminal editor at the line shown with nothing executed, a file name with spaces and shell characters kept as one quoted argument, a draft left alone, a GUI editor launched (and a launch failure and no editor reported) with the viewer kept open. All five fail before the change. Refs #366
This was referenced Oct 18, 2026
raiseCatError
added a commit
that referenced
this pull request
Oct 18, 2026
This was referenced Oct 18, 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.
Why
#366 asks for clearer paths between NMSh's native surfaces and the editors people already use, reusing installed tools rather than building editors.
/viewcould hand a file only to the native/edit(e), and its own notes for a partly shown or undecodable file said "less or an editor" without a way to get there./openalready knows how to reach the person's editor safely.What changed
oin/viewof a file sends the file and the first line on screen to the same bridge/openuses (resolveHostActions, Settings → Open with):Opened in Zed.(or why it could not start).$VISUAL/$EDITOR: its command (nvim +41 /path/notes.txt,hx '/path/my notes.txt:41'), quoted for the session's shell, goes in the composer for the person to run — never run for them — and the viewer closes so it is in view.VISUAL/EDITOR, or choose Open with).m) keeps the line. Stored output is not a file and offers nothing new./viewdescription listseando. Footer:e edit · o open in editor.No new launcher, editor registry or PTY ownership; paths stay single argv elements; nothing runs without the person's Enter.
Verification
tests/viewerOpenEditor.test.tsdrives the real key handler and the real bridge with a fake host (terminal editor at the line shown with nothing executed — the capture session throws on any submission; a file namedmy notes; rm -rf ~ $(x).txtkept as one quoted argument; a draft left alone; a GUI editor launched, a launch failure and no editor reported, viewer kept open) andtests/viewer.test.ts(key → action for files, Markdown rendered vs. source, output; footer; notes).npm run verify:fast— pass.npm run verifyon5d81d93e(NMSH_TEST_TMPDIR=/Volumes/T7Tmp/ai-dev, load 4–13): exit 0, 3,148 tests, 3,146 pass, 2 skipped, 0 failed.Physical QA (not done)
Checklist:
docs/testing/v022-physical-qa.mdpass 2 (in #435). Ghostty and Terminal.app:/viewa long file, scroll,owithEDITOR=nvim(composer getsnvim +N file; Enter opens it at that line; quitting returns to NMSh), withEDITORunset outside an editor (the viewer explains), and inside Zed's and VS Code's integrated terminals (the file opens there at the line). Narrow width: the footer wraps and Esc stays reachable.Refs #366