You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add different color for correct/incorrect command #3439
Add a different color for highlighting if the first word of a command is correct or incorrect (running the command won't result in "The term 'abcedf' is not recognized...").
For example, assuming an environment where v is not a valid program but vi is, typing a command such as v file.txt will highlight the v in a different color to show that v is not a valid command. When typing vi file.txt, vi will have a different color to show that it is a valid command.
What if the first word is a variable? Should we check if it exists? And what if it's a file instead? I believe typing just a filename will open it in default program, same as if given as an argument to Start-Process (can't test it over SSH).
Also, should this coloring apply only to start of the line, or any command? It could be complicated if validity of it changes mid-line, e.g. $env:PATH += $path_to_v; v or Set-Alias 'v' 'vim'; v.
Fish has a different coloring for variables, which is activated as soon as you type '$'. It seems to not change colors with files unless prefaced with './' and the file is executable. And it's only at the first word.
After using it for a long time, I've found it very useful for catching mistakes before executing. I'd love to see this in PowerShell as well.
Hello, I see this issue hasn't been touched in years. I use PSReadLine with Powershell on my Windows work laptop. This is a feature I am missing that I have in zsh on my personal. Would a PR be accepted that implements this behavior?
Activity
dkaszews commentedon Oct 21, 2022
What if the first word is a variable? Should we check if it exists? And what if it's a file instead? I believe typing just a filename will open it in default program, same as if given as an argument to
Start-Process(can't test it over SSH).Also, should this coloring apply only to start of the line, or any command? It could be complicated if validity of it changes mid-line, e.g.
$env:PATH += $path_to_v; vorSet-Alias 'v' 'vim'; v.TransientError commentedon Oct 21, 2022
Fish has a different coloring for variables, which is activated as soon as you type '$'. It seems to not change colors with files unless prefaced with './' and the file is executable. And it's only at the first word.
After using it for a long time, I've found it very useful for catching mistakes before executing. I'd love to see this in PowerShell as well.
davidsanchez222 commentedon Jun 23, 2026
Hello, I see this issue hasn't been touched in years. I use PSReadLine with Powershell on my Windows work laptop. This is a feature I am missing that I have in zsh on my personal. Would a PR be accepted that implements this behavior?