Skip to content

Custom Tab completion issues with PSReadLine #64

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

Closed
staxmanade opened this issue Nov 12, 2013 · 4 comments
Closed

Custom Tab completion issues with PSReadLine #64

staxmanade opened this issue Nov 12, 2013 · 4 comments

Comments

@staxmanade
Copy link
Contributor

Hello,

I recently started playing with some custom tab completion and am noticing an issue when I have PSReadLlinerunning (vs not).

Repro Steps:

  • Start up a powershell prompt without PSReadLline
  • Run the following commands to setup a sample tab completion.
    if (-not $global:options) { $global:options = @{CustomArgumentCompleters = @{}; NativeArgumentCompleters = @{}}}
    $global:options['NativeArgumentCompleters']['sampleTab'] = {"asdf", "fdsa"}
    $function:tabexpansion2 = $function:tabexpansion2 -replace 'End\r\n{','End { if ($null -ne $options) { $options += $global:options} else {$options = $global:options}'
  • at the command type sampleTab <tab> (notice how it expands to asdf and fdsa.

Now run the same steps above with PSReadLline setup.

Notice sampleTab <tab> (tab once) does nothing, and sampleTab <tab> (tab twice) clears the line?

Any thoughts?

@staxmanade
Copy link
Contributor Author

looks like this isn't specific to custom tab completion...

typing:

ls <tab><tab>

clears the line.

@lzybkr
Copy link
Contributor

lzybkr commented Nov 12, 2013

This sounds like issue #46 which has been fixed for awhile. Also, based on your repro steps, I can't reproduce the problem.

What version of the dll do you have? This will tell you:

(dir ([PSConsoleUtilities.PSConsoleReadLine].Assembly.Location)).VersionInfo.FileVersion

The current version is 1.0.0.3.

BTW, I highly recommend you look at https://github.com/lzybkr/TabExpansionPlusPlus. This module makes it really easy to add your own completers.

@lzybkr lzybkr closed this as completed Nov 12, 2013
@staxmanade
Copy link
Contributor Author

when I ran (dir ([PSConsoleUtilities.PSConsoleReadLine].Assembly.Location)).VersionInfo.FileVersion I get 1.0.0.3.

Thanks for the TabExpansionPlusPlus link - will look into that...

@lzybkr
Copy link
Contributor

lzybkr commented Nov 13, 2013

I see - it doesn't repro for me because I'm building from the latest sources, not using the published binaries.

I'll update the binaries soon - until then you can build your own and the problem should go away.

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

2 participants