You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think Show-PSEditor has great potential for integration with PSReadLine's ViEditVisually function; the latter allows invocation of an editor as a richer alternative to direct command-line editing, and Show-PSEditor's features make it ideally suited to that.
However, for this to be possible:
PSReadLine would have to be enhanced to allow specifying a PowerShell command via $env:VISUAL or $env:EDITOR - currently, only an external program may be specified.
Show-PSEditor's current behavior too could be enhanced to support that:
Ideally, there'd also be a way to pass the startup cursor position, so as to place the cursor in the editor buffer in the same position it was in the command-line buffer, as supported by code and micro, for instance (expressed in terms of the target line and column number).
That said, PSReadLine would either have to be enhanced to somehow communicate this position to the ViEditVisually function; however, a custom implementation of said function can enable such functionality already (see below).
See PowerShell/PowerShell#21525 (comment) for a proof-of-concept that allows you to set $env:VISUAL or $env:EDITOR to 'psedit' or 'Show-PSEditor' to experiment with what such an integration could look like.
The text was updated successfully, but these errors were encountered:
I think
Show-PSEditor
has great potential for integration with PSReadLine'sViEditVisually
function; the latter allows invocation of an editor as a richer alternative to direct command-line editing, andShow-PSEditor
's features make it ideally suited to that.However, for this to be possible:
PSReadLine would have to be enhanced to allow specifying a PowerShell command via
$env:VISUAL
or$env:EDITOR
- currently, only an external program may be specified.Show-PSEditor
's current behavior too could be enhanced to support that:code
andmicro
, for instance (expressed in terms of the target line and column number).ViEditVisually
function; however, a custom implementation of said function can enable such functionality already (see below).See PowerShell/PowerShell#21525 (comment) for a proof-of-concept that allows you to set
$env:VISUAL
or$env:EDITOR
to'psedit'
or'Show-PSEditor'
to experiment with what such an integration could look like.The text was updated successfully, but these errors were encountered: