PSReadLine 2.0 Vi mode visual editing with vim doesn't work
See original GitHub issueI can’t edit a command line in vim
with PSReadLine 2.0. This worked fine in previous versions so I think it might have something to do with the change in output encoding.
Environment data
PS version: 6.1.0-preview.503 PSReadline version: 2.0 os: 10.0.15063.0 (WinBuild.160101.0800) PS file version: 6.1.0
Steps to reproduce or exception report
- set
$env:VISUAL = 'vim.exe'
- type command to edit
- press
ESC
- press
v
result:
- press
ZQ
to exit vim and the previous screen is cleared.
If I change $env:VISUAL = 'gvim.exe'
everything is fine since gvim opens out of process.
Behavior is the same with PSReadLine under Windows PowerShell 5.1…
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
PSReadLine 2.0 Vi mode visual editing with vim doesn't work
I can't edit a command line in vim with PSReadLine 2.0. This worked fine in previous versions so I think it might have...
Read more >Different cursor for different Vim modes in Powershell
This option sets the visual indication for the current Vi mode. Either insert mode or command mode. The valid values are as follows:...
Read more >about PSReadLine - PowerShell
PSReadLine works with the default Windows console host, Window Terminal, and Visual Studio Code. It doesn't work in the Windows PowerShell ...
Read more >Set-PSReadLineOption (PSReadLine) - PowerShell
Module: PSReadLine. Customizes the behavior of command line editing in PSReadLine. ... Example 6: Use ViModeChangeHandler to display Vi mode changes.
Read more >Changes.txt 2.2.2
- Make `Ctrl+r` and `Ctrl+s` in `Vi` edit mode work the same way as in `Emacs` edit mode (#3148) (Thanks @davetapley!) ... -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m closing this issue. It’s long been resolved and I must’ve forgotten to close it then. 😦
@lzybkr Adding VIM switches to
$env:VISUAL
breaksViEditVisually
functionality do to the way the command is validated. I’ll see if I can fix that.In the mean time, I created a batch file
@vim.exe -T win32 %*
which is called instead. Usingwin32
has no effect.dumb
actually works but all the VT sequences are written to the console as well:As far as
Set-ConsoleMode
, I’ve been using that since you published the Gist for me – it has no effect.