feat(composer): Ctrl+X opens $EDITOR with the current input#661
Merged
Conversation
Composes a long prompt in the user's preferred editor instead of typing it inside the TUI. Match for opencode's `<C-x>e` and codex's `<C-g>` (issue #647). Editor resolution follows the standard Unix precedence: $GIT_EDITOR → $VISUAL → $EDITOR. Picked an explicit GIT_EDITOR-style fallback over hardcoding nano/notepad so the user's existing shell config carries through. Missing-editor and non-zero-exit cases surface as a warning card in the chat log; on success the buffer is replaced with whatever the user saved (one trailing newline stripped, since most editors auto-append one). Implementation notes: - New action flag in multiline-keys (`openExternalEditor: true`) so the pure reducer stays testable and PromptInput just signals up. - App.tsx flips raw-mode off around the spawn so the editor can use cooked line-buffered input; bracketed-paste / alt-screen are managed by the editor itself via DEC mode 1049. - Spawn uses `shell: true` so $EDITOR strings like `nvim --noplugin` or `code --wait` split correctly across platforms (same shape as the existing `commit.ts` editor invocation). Refs #647 (the picker-keymap half of that issue is a separate change).
2 tasks
esengine
added a commit
that referenced
this pull request
May 11, 2026
Hotfix for 0.39.0 install failure: the `postinstall: patch-package` hook + missing `patch-package` runtime dep + missing `patches/` in the files array meant fresh `npm install` / `npx reasonix@latest` runs crashed before the binary was usable. 0.39.0 has been deprecated on npm and `latest` rolled back to 0.38.0. Removes the patch-package machinery entirely — it can't work for a published library since npm hoists `ink` out of reasonix's own `node_modules`. The ink alt-screen render fix (#639) will return via a forked ink + `npm:` alias (#663) in a later release. Piggybacks three PRs that landed since 0.39.0: - #632 fix(web): actionable web_search / web_fetch errors - #661 feat(composer): Ctrl+X opens \$EDITOR - #662 feat(composer): Ctrl+P / Ctrl+N picker navigation
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…#661) Composes a long prompt in the user's preferred editor instead of typing it inside the TUI. Match for opencode's `<C-x>e` and codex's `<C-g>` (issue esengine#647). Editor resolution follows the standard Unix precedence: $GIT_EDITOR → $VISUAL → $EDITOR. Picked an explicit GIT_EDITOR-style fallback over hardcoding nano/notepad so the user's existing shell config carries through. Missing-editor and non-zero-exit cases surface as a warning card in the chat log; on success the buffer is replaced with whatever the user saved (one trailing newline stripped, since most editors auto-append one). Implementation notes: - New action flag in multiline-keys (`openExternalEditor: true`) so the pure reducer stays testable and PromptInput just signals up. - App.tsx flips raw-mode off around the spawn so the editor can use cooked line-buffered input; bracketed-paste / alt-screen are managed by the editor itself via DEC mode 1049. - Spawn uses `shell: true` so $EDITOR strings like `nvim --noplugin` or `code --wait` split correctly across platforms (same shape as the existing `commit.ts` editor invocation). Refs esengine#647 (the picker-keymap half of that issue is a separate change).
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
Hotfix for 0.39.0 install failure: the `postinstall: patch-package` hook + missing `patch-package` runtime dep + missing `patches/` in the files array meant fresh `npm install` / `npx reasonix@latest` runs crashed before the binary was usable. 0.39.0 has been deprecated on npm and `latest` rolled back to 0.38.0. Removes the patch-package machinery entirely — it can't work for a published library since npm hoists `ink` out of reasonix's own `node_modules`. The ink alt-screen render fix (esengine#639) will return via a forked ink + `npm:` alias (esengine#663) in a later release. Piggybacks three PRs that landed since 0.39.0: - esengine#632 fix(web): actionable web_search / web_fetch errors - esengine#661 feat(composer): Ctrl+X opens \$EDITOR - esengine#662 feat(composer): Ctrl+P / Ctrl+N picker navigation
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.
Composes a long prompt in the user's preferred editor instead of typing it inside the TUI. Matches
opencode <C-x>eandcodex <C-g>— issue #647.Changes
src/cli/edit/external-editor.ts— resolves the editor viaGIT_EDITOR → VISUAL → EDITOR(Unix precedence), writes the current buffer to a temp file, spawns the editor inheriting the TTY, reads back on exit, strips one trailing newline.multiline-keys.ts— new pure action flagopenExternalEditor: trueonCtrl+X, so the reducer stays testable.PromptInput.tsx— newonOpenExternalEditorcallback prop.App.tsx— wires the callback: flips raw-mode off around the spawn so the editor owns cooked line-buffered input, restores raw-mode on exit, and replaces the composer value with the result. Missing-editor and non-zero-exit cases surface as a warning card in the chat log.shell: truesoEDITOR="nvim --noplugin"andEDITOR="code --wait"split correctly cross-platform (same shape as the existingcommit.tsinvocation).Refs #647 — the picker-keymap half of that issue (Ctrl+N/P navigating the slash picker) is a separate change, coming next.
Test plan
npm run verify— 2609 passed (added 8), 2 skippedtests/external-editor.test.tscovers env-var precedence + trim + empty-string handlingtests/multiline-keys.test.tscovers Ctrl+X → action flag, plainxstill insertsexport EDITOR=nano, hit Ctrl+X in the composer, type, save+exit, verify input replaced