PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Coloring existing and non-existing commands

Open yihuajack opened this issue 4 years ago • 2 comments

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 avatar Mar 05 '21 14:03 yihuajack

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?

thomazmoura avatar Aug 09 '22 12:08 thomazmoura

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"...

yutotakano avatar May 12 '24 21:05 yutotakano