I've started using PowerShell, but am missing fzf. It'd be great to have PowerShell hooked up to fzf. In particular, ctrl-r.
My attempt so far:
Set-PSReadlineKeyHandler -Key Ctrl+r `
-ScriptBlock {
Get-Content (Get-PSReadlineOption).HistorySavePath | fzf +s -m --tiebreak=index --tac --toggle-sort=ctrl-r > foo
$fzf=cat foo
[Microsoft.PowerShell.PSConsoleReadLine]::Insert($fzf)
}
There's a bug though: when I hit Ctrl-r, fzf is executing (according to ps), but I cannot see fzf's curses interface. I wonder if this is a limitation of PowerShell's PSReadline?
This https://github.com/junegunn/fzf/blob/master/src/README.md#system-requirements says Windows is not supported.
I'm using PowerShell on OSX, sorry, I should have mentioned.
OSX 10.11.6
fzf 0.13.2
@balta2ar Turned out that fzf can now work on Windows with its new linux subsystem. See https://github.com/junegunn/fzf.vim/issues/186
@tomfitzhenry Hi, unfortunately I have zero experience in PowerShell, so I can't really help you with this. Please let me know if you find the solution.
Seems like this is now supported by https://github.com/kelleyma49/PSFzf
@prabirshrestha Thanks. I'll mention the project somewhere on the wiki.
Most helpful comment
Seems like this is now supported by https://github.com/kelleyma49/PSFzf