Does Bash colors output only on MacOS?

Hey huys,

I’m watching many tutorials where people have their console output (bash) colored.

They have errors in red or WARNings with yellow background. Most frequently i see it with npm outputs.

Can I have it on Windows? Or is it just on MacOS?

Don’t have a mac but linux has them too. For windows try using PowerShell(built-in) instead of cmd. It has limited color support and provides a unix like environment.

Windows 10 now has a bash shell, and it will support coloring (but I think you have to turn it on). You have to put your Windows in Developer Mode and turn on the Windows subsystem for Linux.

1 Like

I use bash on windows

I believe that instructions for playing with terminal colors in Ubuntu should more or less apply to Win10 bash. I just got a computer with Win10 last night, so I haven’t played with this yet. If I find out anything exciting, I’ll let you know.

ETA: This StackOverflow answer which may be related

1 Like

Wish I could help more but I have no experience on using bash on Ubuntu on windows. Though I have a windows system I dual boot linux for my coding environment.

1 Like

Try cmder, it looks way better than cmd or powershell.

1 Like

i never use cmd or powershell, always bash on windows, cause i know basic linux commands. Why would I use cmder?

It looks better than the bash as well :slight_smile:

cmder is a console emulator, so you can use cmd, powershell and bash, but with a nice UI. And you can have multiple tabs, which I find really useful.

I use MobaXterm already for SSH and RDP. I just pulled up its shell tool and it seems lovely.

So now that I’m home with my new toy, I’ve been playing around and it looks like instructions you can find to modify bash colors in Ubuntu bash work fine in “Bash on Ubuntu on Windows” (in other words, edit ~/.bashrc.

but were you able to edit the looks of the output of programs, such as npm? I know i can edit the user line, etc… :slight_smile:

Any ubuntu/debian instructions should work. I haven’t gotten as far as playing with node on this computer, but it looks like you can either use modules like chalk, colors, or cli-color or pick colors manually with commands like console.log('\x1b[36m', 'sometext' ,'\x1b[0m');

I decided to try ConEmu terminal emulator, and for now I’m in love. Bash on windows sucks :smiley: