Code Monkey home page Code Monkey logo

Comments (9)

Moeologist avatar Moeologist commented on May 26, 2024

It means that scoop-completion offer completions to other commands?
I'm confused about this.
Would you mind explaining a little more detail?

from scoop-completion.

 avatar commented on May 26, 2024

It means that scoop-completion offer completions to other commands?

yes. it modifies the behaviour for other commands and shows additional stuff even for commands that are not preceded by scoop.

look at the two lines highlighted by red.

scoop-completion


regards ratatoeey

from scoop-completion.

Moeologist avatar Moeologist commented on May 26, 2024

@ratatoeey

Set-PSReadlineKeyHandler will modify all existing TabCompletion behaviour. All TabCompletion will show menu rather than cycle words. scoop-completion doesn't handle gc commands. You can disable Import-Module scoop-completion, and try again.

C:\Users\ala
❯ Get-Module -All|Select-Object Name,Path|Sort -Property Path


Name                                     Path
----                                     ----
Microsoft.PowerShell.Commands.Management C:\Dev\Scoop\apps\pwsh\current\Microsoft.PowerShell.Comma…
Microsoft.PowerShell.Commands.Utility    C:\Dev\Scoop\apps\pwsh\current\Microsoft.PowerShell.Comma…
Microsoft.PowerShell.Management          C:\dev\scoop\apps\pwsh\current\Modules\Microsoft.PowerShe…
Microsoft.PowerShell.Utility             C:\dev\scoop\apps\pwsh\current\Modules\Microsoft.PowerShe…
Microsoft.PowerShell.PSReadLine2         C:\dev\scoop\apps\pwsh\current\Modules\PSReadLine\Microso…
PSReadLine                               C:\dev\scoop\apps\pwsh\current\Modules\PSReadLine\PSReadL…
posh-vcpkg                               C:\Dev\vcpkg\scripts\posh-vcpkg\0.0.1\posh-vcpkg.psm1
npm-completion                           C:\Users\ala\Documents\PowerShell\Modules\npm-completion\…
posh-git                                 C:\Users\ala\Documents\PowerShell\Modules\posh-git\1.0.0\…
PSColor                                  C:\Users\ala\Documents\PowerShell\Modules\PSColor\1.0.0.0…
yarn-completion                          C:\Users\ala\Documents\PowerShell\Modules\yarn-completion…


C:\Users\ala
❯ gc -v

Press Tab Key

from scoop-completion.

 avatar commented on May 26, 2024

Set-PSReadlineKeyHandler will modify all existing TabCompletion behaviour.

oh, so there is no way to avoid it.

Maybe microsoft could add a option to not display the extra stuff in powershell 6.2, its not happening anymore on powershell 5.1 I might have mixed things up. i filed the issues MicrosoftDocs/PowerShell-Docs#5046 MicrosoftDocs/PowerShell-Docs#5045. update: MicrosoftDocs/PowerShell-Docs#5046 to MicrosoftDocs/PowerShell-Docs#5046 (comment)


scoop-completion doesn't handle gc commands.

got it. it can't be helped but gc parameters will be displayed. and scoop-completion is not called for gc. right?

You can disable Import-Module scoop-completion, and try again.

disabled it, tried again and it was back to normal. obviosuly, scoop parameters were not getting auto-completed.

so then I enabled it again, and it was back, so this is the same behaviour as before. I thought you meant that disabling it would fix it somehow, though it didn't make sense to me as no code had been changed in scoop-completion or powershell 6.2 in disabling. I disabled it by commenting it out in $profile for Powershell 6, just so we are clear.


i think you forgot or I forgot to read the answer. so repeating again, in

function script:ScoopAlias($fliter) {

is it supposed to be `$fliter'

after :ScoopAlias( , as I think it might be a mistake and should be $filter like in other functions in the same ffile.


regards ratatoeey

from scoop-completion.

Moeologist avatar Moeologist commented on May 26, 2024

Sorry...I mislead you.
Code has no matter(ScoopAlias handle subcommand by scoop alias). But this line:

Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

It is not a good idea. I shoud not modify user profile in a module.
I have removed this line from scoop-completion.Please upgade scoop-completion and try.

from scoop-completion.

Moeologist avatar Moeologist commented on May 26, 2024

Extra stuff was caused by MenuCompletion.Set-PSReadLineKeyHandler only set shortcut.

from scoop-completion.

 avatar commented on May 26, 2024

after updating second line of extra stuff is gone. see screenshot above.

now only the first line of extra stuff is left.

should the version number be also bumped, its still 0.1.0? I just find it a bit odd, but no big deal.

> scoop list scoop-completion
Installed apps matching 'scoop-completion':

  scoop-completion 0.1.0 [scoop-completion]

regards ratatoeey

from scoop-completion.

Moeologist avatar Moeologist commented on May 26, 2024
scoop update
scoop update scoop-completion

I will fix "fliter" spelling mistake above.
Thank you very much.

from scoop-completion.

 avatar commented on May 26, 2024

thanks for everything, I might have forgot to run scoop update scoop-completion after running scoop update.

updated successfully.

scoop-completion 0.1.1 [scoop-completion]

feel free to close the issue. as I think the first line extra stuff can not be configured unless PSReadline gets enhanced. and all my issues were resolved, and I learned some stuff.


regards ratatoeey

from scoop-completion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.