Skip to content

Support command arguments for VisualEditing#5174

Open
sharpchen wants to merge 1 commit into
PowerShell:masterfrom
sharpchen:EDITOR-with-args
Open

Support command arguments for VisualEditing#5174
sharpchen wants to merge 1 commit into
PowerShell:masterfrom
sharpchen:EDITOR-with-args

Conversation

@sharpchen

@sharpchen sharpchen commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Resolves #3214

Bash readline supports $EDITOR with command arguments, I wish to have this in PSReadLine as well.

export EDITOR='nvim --cmd "lua vim.env.foo = 1"'
$env:EDITOR = 'nvim --cmd "lua vim.env.foo = 1"'

This change adds following possible patterns for visual editor:

  1. path/to/foo.exe --args
  2. "path/with space/foo.exe" --args
  3. foo.exe --args

Note that ProcessStartInfo.Arguments only allows " for quoting components, which is different from bash, this worth to be mentioned in documentation.
I didn't add test since I neither found an existing test for ViEditVisually nor am familiar enough with this repository to write from scratch.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: Open in CodeFlow

@sharpchen sharpchen force-pushed the EDITOR-with-args branch 3 times, most recently from 62a025f to c57a35e Compare June 28, 2026 19:53
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.

Make the ViEditVisually function more flexible by allowing $env:VISUAL / $env:EDITOR to contain an executable name *with options*

1 participant