mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
fix: avoid prompt_toolkit complex tempfile bug and prefer nvim first
Setting buffer.tempfile = 'prompt.md' pushed prompt_toolkit into its complex-tempfile path, which creates a temp dir and then calls os.makedirs() on that same path when no subdirectory is present. That raises EEXIST before the editor can launch. Keep prompt_toolkit on the simple tempfile path with .md suffix, and make the editor fallback chain explicit on both surfaces: $VISUAL -> $EDITOR -> nvim -> vim -> vi -> nano.
This commit is contained in:
parent
db7c5735f0
commit
d056b610b7
3 changed files with 15 additions and 12 deletions
|
|
@ -33,12 +33,13 @@ describe('resolveEditor', () => {
|
|||
expect(resolveEditor({ EDITOR: 'nvim', PATH: dir })).toBe('nvim')
|
||||
})
|
||||
|
||||
it('prefers vim over vi over nano on $PATH', () => {
|
||||
it('prefers nvim over vim over vi over nano on $PATH', () => {
|
||||
exe('nano')
|
||||
exe('vi')
|
||||
const vim = exe('vim')
|
||||
exe('vim')
|
||||
const nvim = exe('nvim')
|
||||
|
||||
expect(resolveEditor({ PATH: dir })).toBe(vim)
|
||||
expect(resolveEditor({ PATH: dir })).toBe(nvim)
|
||||
})
|
||||
|
||||
it('falls back to vi when only vi and nano exist', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue