Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result of TAB completion not written to command line #85

Closed
f0rdprefect opened this issue Jun 22, 2021 · 12 comments
Closed

Result of TAB completion not written to command line #85

f0rdprefect opened this issue Jun 22, 2021 · 12 comments

Comments

@f0rdprefect
Copy link

f0rdprefect commented Jun 22, 2021

DO

  1. Open Powershell
  2. Set-PSReadLineKeyHandler -Key Tab -ScriptBlock { Invoke-FzfTabCompletion }
  3. Type something and hit <TAB>
  4. fzf opens and I can type to narrow down matches and select the item I want on the command line
  5. hit <ENTER>

GET

the text I typed to narrow down the list of results

EXPECT

the Item I selected appended to my command line

Remark

Powershell 5.1.17763.1971

Using all other chords like - R work as expected. I guess I am missing something? Anything else I can try?

@kelleyma49
Copy link
Owner

TabCompleteIssue

Can you give me more information? I can't see to recreate your issue. See attached gif.

@f0rdprefect
Copy link
Author

f0rdprefect commented Aug 12, 2021 via email

@kelleyma49
Copy link
Owner

When you get a chance, try running the following before tab completion:

$error.Clear()

Try the tab completion, then run the following after and post the output:

$error

@koalp
Copy link

koalp commented Nov 8, 2021

I have the same issue for and there is no $error.

What I’ve done :

$error.Clear()
$error.Cl<TAB>  # completion menu showing but nothing append after selection in fzf
$error # no output

@ghost
Copy link

ghost commented Nov 10, 2021

Confirm tab completion not working here also.

EDIT: Installing the latest version of PowerShell from here and using it instead of the Windows one fixed the issue for me.

@redcoreit
Copy link

redcoreit commented Nov 26, 2021

I'm experiencing this issue as well.
$error is empty.

Other information:
If I try to set shortcut for a command like Invoke-FuzzyGitStatus then it fails similarly, but it might be another issue.

Name             : ConsoleHost
Version          : 5.1.19041.1151
InstanceId       : 58407a44-9a4c-451d-a21c-338dc8c5723f
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : hu-HU
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.2.9      PSFzf                               {Enable-PsFzfAliases, Invoke-FuzzyEdit, Invoke-FuzzyFasd, Invoke-FuzzyGitStatus...}
Script     2.1.0      PSReadline                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...}
Script     0.7.3      posh-git                            {Add-PoshGitToProfile, Add-SshKey, Enable-GitColors, Expand-GitCommand...}
Script     1.4.3      ZLocation                           {Get-ZLocation, Invoke-ZLocation, Pop-ZLocation, Remove-ZLocation...}

@belotn
Copy link
Contributor

belotn commented Dec 12, 2021

I have 2 version of powershell here (5.1 and 7.2), the issue appears in 5.1 but not in 7.2.

@belotn
Copy link
Contributor

belotn commented Jan 9, 2022

On powershell 5, $script:fzfOuput contains 2 value the selected FZF return and the queried path, on powershell 7 only the result...

image

@roachsinai
Copy link

Same issue on powershell 5.

@kelleyma49
Copy link
Owner

I see what is happening, but I'm not sure why.

The order of outputs from fzf is inconsistent in PowerShell 5. fzf is supposed to output the query first, then the selections. It does this in PowerShell 7 just fine, but not in 5.

kelleyma49 added a commit that referenced this issue Jan 30, 2022
- don't use PrintQuery as I'm getting unexpected output ordering under
  Powershell 5
@roachsinai
Copy link

roachsinai commented Feb 2, 2022

@kelleyma49 thanks! It works. But seems it not work with soft link with fuzzyselectdirectory. I will open a new issue.

@roachsinai
Copy link

@kelleyma49 thanks! It works. But seems it not work with soft link with fuzzyselectdirectory. I will open a new issue.

Soft link not work is my fault, sorry for that.

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

No branches or pull requests

6 participants