Code Monkey home page Code Monkey logo

Comments (15)

hanskokx avatar hanskokx commented on June 12, 2024 1

Good to know. I'll add that to my update-all-the-things.ps1 script. Thanks!

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

I'm using powershell 7.2 and psreadline 2.2.0-beta4 and it works as expected, give me a few minutes to update and see if I get the same error.

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

Hmm that worked for me, when you run enable-powertype it runs Set-PSReadLineOption -PredictionSource Plugin behind the scenes, are you sure that you are on PSReadline 2.2.0-beta5? It should have the PredictionSource parameter.

The only other difference is that I'm on Windows 10.

Could you try to run Set-PSReadLineOption -PredictionSource Plugin on it's own and see if you get the same error?

You could also try get-help Set-PSReadLineOption and see if it lists PredictionSource.

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

That might be part of the problem. I was on 2.1.0-beta1 when I tried, then I upgraded it, and try to Set-PredictionSource manually, which also failed (something about it not being defined.)

I just ran enable-powertype again, and it didn't throw any errors. Then again, I don't see it doing anything, either.

image

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

Here are a few things to try

  • Just to type gi and it should suggest git if you then select git it should suggest a command, currently it dosent have a definition for any commands starting with get- therefor it does not suggest anything.
  • If you want a list run Set-PSReadLineOption -PredictionViewStyle ListView
  • If you want both history and plugins run Set-PSReadLineOption -PredictionSource HistoryAndPlugin (note you can combine this and the one above into one command)

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

image

Do I need to set something in my profile to enable it between launches? Seems like the answer is yes. (Perhaps that should be in the instructions, too.)

Setting Set-PSReadLineOption -PredictionViewStyle ListView gave me what I expected, per the .gif example in the documentation. Maybe this should also be part of the install instructions? Will this need to be stored in my profile as well?

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

You need to put the following in your $profile if you want it to be permanent:

Enable-PowerType
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView

But yes it should be in the documentation, but as I'm quite early in the development I haven't had time to write any extensive documentation yet, but its on the todo #10.

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

Excellent. It seems to be working as-expected!

Personally, I'm not as well-versed with PowerShell as I am with bash, zsh, and the like. How do I ensure that this plugin stays up-to-date?

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

You could put Update-Module PowerType -AllowPrerelease in your profile but that would make all newly started sessions delay alot..

I have been thinking about creating a application that would monitor powershell modules, winget, dotnet tool and npm tools for updates but this project currently occupies all my free time.

But I'm no pro when it comes to PowerShell, you could ask in the PowerShell Discord if there is a better solution out there!

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

Actually, I ended up making a function in my profile. It would have been nice if PowerType would have seen that function.

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

I will have to give it some thinking the code that gives you the suggestions doesn't have direct access to you powershell session, not my choice, its how Microsoft designed the suggestion api..

I might be able to enumerate all commands that exists when you run Enable-PowerType but all that are created after would be hard to get, sadly this will be low on the current priority list as I'm trying to get the git dictionary completed.. git supports a huge amount of commands and parameters.

But you could try ctrl + space, that should list your commands using a built in argument completer (this can also be used when using cd)

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

Hmm. Ctrl+space invokes my PowerToys Run dialog. Can this be modified?

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

I'm 99% sure it can but i have no idea how..
I'm guessing its a psreadline option (i'm not at my pc right now so i can't check)

from powertype.

hanskokx avatar hanskokx commented on June 12, 2024

from powertype.

AnderssonPeter avatar AnderssonPeter commented on June 12, 2024

Just a guess but try Set-PSReadLineKeyHandler -Key 'Ctrl+Tab' -Function MenuComplete

from powertype.

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.