0

With PowerShell on Linux (pwsh), is there a way to get syntax highlighting on the console in the same way that it works by default in the Windows console?

  • 3
    Maybe it's the terminal you're using? I get syntax highlighting with pwsh on a CentOS 7 box. – JOTN Sep 29 '18 at 17:13
  • You are correct. I am using a Minimal CentOS VM installed into a VMware with no GUI. Oon the console, I get no syntax highlighting, but when I connect into this VM via putty, I do get syntax highlighting. Would be good to know how to get it also in the VM. – roysubs Sep 29 '18 at 21:20
  • 1
    Try echo $TERM to figure out which terminal it thinks you're using at the command prompt. Usually it's linux if you're at the console, it might be something like xterm-256color or xterm-color if you're using a terminal program or ssh client, if at the console it isn't linux try doing TERM=linux pwsh and see if it does work. If your terminal is linux then maybe it's a powershell bug? – fdmillion Sep 30 '18 at 5:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.