Skip to content

Coloring existing and non-existing commands #2269

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

Open
yihuajack opened this issue Mar 5, 2021 · 2 comments
Open

Coloring existing and non-existing commands #2269

yihuajack opened this issue Mar 5, 2021 · 2 comments
Labels
Issue-Enhancement It's a feature request. Issue-Triaged It indicates an issue was triaged Not-Planned

Comments

@yihuajack
Copy link

Description of the new feature/enhancement

Inspired by zsh's plugin zsh-syntax-highlighting, the feature that coloring existing cmdlets, functions, script files, or executable programs with green and non-existing ones with red. Besides, it can underline paths or filenames if they are existing and does not underline if they does not exist.
From #687.
Expected effects:
image

Proposed technical implementation details (optional)

@yihuajack yihuajack added the Issue-Enhancement It's a feature request. label Mar 5, 2021
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Mar 5, 2021
@theJasonHelmick theJasonHelmick added Issue-Triaged It indicates an issue was triaged Not-Planned and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Apr 6, 2021
@thomazmoura
Copy link

Hey guys, any chance on at least a feedback of what would be needed or the feasibility of such a change?

Since trying zsh I've been wanting this feature, but so far that closest I've seen is pwsh-syntax-highlighting from digitalguy99. I even managed to optimize it so it would look like a bit more real time, but the limitation of not being able to trigger it at every stroke seems to defeat its purpose. Also, the coloring API used doesn't seem to work on Linux - I know echoing special characters seem to solve it, but I don't know how I could do it for text that has already been typed.

So, what I would like to know is:

  • Is there currently any way to trigger a PSReadLineKeyHandler (or something like it) on every key stroke?
  • Is there a way to color the text the user has already typed (and change it afterwards) that would work on both Windows and Linux?

@yutotakano
Copy link

The third party software 'Clink' for cmd.exe is able to achieve this without any visible delays, and it's been a massive help in knowing whether you typed a command correctly before you continue typing.

image
image

Currently it's one of the rather big UX issues that's blocking my full migration to Powershell. It's sad that this issue is labelled as "Not Planned"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request. Issue-Triaged It indicates an issue was triaged Not-Planned
Projects
None yet
Development

No branches or pull requests

4 participants