JanDeDobbeleer / oh-my-posh2

A prompt theming engine for Powershell
MIT License
5.19k stars 284 forks source link

What is the $with variable / -with parameter for? #305

Closed sql-sith closed 4 years ago

sql-sith commented 4 years ago

I'm almost too embarrassed to ask this because I think I'm missing something obvious. A custom theme has one requirement: to implement a PS function called Write-Theme. That function has two parameters, $lastCommandFailed and $with. I have been mucking around with themes and noticed that the $with parameter never seems to have a value. So I searched the code for instances of $with and -with, but only found this:

So I've been wondering: what is the purpose of this parameter that never seems to have a value, is almost never referenced in the code, and when it is referenced it seems to fall from the sky, showing up in a function that is not called from anywhere? :)

Actually, I assume that Write-WithPrompt is a callback to build the prompt, but I honestly can't tell what $command/$with actually do. Can you help me out? If they don't do anything, I can simplify my themes. :)

Thanks!

JanDeDobbeleer commented 4 years ago

With is actually another utility I had which shipped with oh-my-posh a long time ago. There's little use nowadays though.

sql-sith commented 4 years ago

Thank you!