question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PSReadLine 2.0 Vi mode visual editing with vim doesn't work

See original GitHub issue

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 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: image

  • 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:closed
  • Created 6 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gwojancommented, Sep 29, 2021

I’m closing this issue. It’s long been resolved and I must’ve forgotten to close it then. 😦

0reactions
gwojancommented, Dec 6, 2017

@lzybkr Adding VIM switches to $env:VISUAL breaks ViEditVisually 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. Using win32 has no effect. dumb actually works but all the VT sequences are written to the console as well:

image

As far as Set-ConsoleMode, I’ve been using that since you published the Gist for me – it has no effect.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found