Skip to content

Conversation

@majiayu000
Copy link

Summary

This PR fixes #98

Changes

  • Modified prepareEditorCommand function in app/cli/cmd/tell.go to properly parse editor commands with arguments
  • The function now uses strings.Fields to split the editor string into the executable name and its arguments
  • Arguments from the environment variable (e.g., --wait in zed --wait) are now properly passed to the editor command
  • Maintains backward compatibility with editors specified without arguments
  • Preserves special handling for vim and nano editors

Technical Details

The fix splits the editor command using strings.Fields(editor) and extracts:

  • editorName: the first part (executable)
  • editorArgs: remaining parts (arguments)

These arguments are then prepended to the editor-specific arguments before the filename, ensuring proper command construction.


Generated with Claude Code

The prepareEditorCommand function now properly handles editor commands
with arguments (e.g., "zed --wait") by splitting the editor string
and passing both the executable and its arguments to exec.Command.

This fixes issue plandex-ai#98 where editors with arguments specified via EDITOR
or VISUAL environment variables were not being recognized correctly.

Signed-off-by: majiayu000 <[email protected]>
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.

prepareEditorCommand doesn't accept arguments

1 participant