1

So currently my shell looks something like this when I SSH into my Debian server:

Dark blue text problem in shell with black background. Using OpenSSH (PowerShell to Debian)

I mostly use PowerShell as the client and customize the background & text colors to match system theme. Command Prompt gives similar results. I could install that fancy Terminal app from the Microsoft Store but wouldn't use it anyway as I don't care to go installing that on all my systems. I like to keep everything as stock as possible & I imagine there'd be a way to fix this if I want to use vanilla PowerShell but first I need to figure out where the dark blue text is coming from. Is the directory text color determined by the Windows client or are there config files on the server driving this? (Perhaps in the .bashrc file?)

At this point it's hard to tell which is the case because I don't see much related to TTY config server-side outside of ssh_config, which doesn't mention anything about shell colors. Client-side when I go to edit PowerShell properties, there are a couple possible settings that could apply to this:

  1. "Popup Text" under PowerShell/CMD >> Properties >> "Colors" Tab, could be what we're looking for but I don't have a Win VM in front of me; I don't know what the default value was and it doesn't seem to make any difference changing this color.

  2. The "Terminal" tab is more likely the settings pertaining to what we see in the shell for an SSH session. I tried "Use Seperate Foreground" and all this did was change my text back to white, but the dark blue text still shows on folders.

  3. Changing the terminal application I tried too, doesn't seem to change anythhing.

At this point I've been floating about this lower priority but very annoying issue for the last year or 2 ongoing as it pops up now and then causing for unreadable output. I've read a lot of other threads mentioning the issue of dark blue text on a black background but I haven't gotten too far with most of them.

The issue presents most prominently in SSH sessions and I even want to say I've seen it a few times in regular PowerShell as well if I'm not mistaken which definitely indicates it to be more of a Windows issue than a Linux one. Now I've tinkered with some command prompt/PowerShell settings since then to where this issue has seemed to have gone away when doing PowerShell stuff but once I initiate an SSH session... hello again old friend. tearing hair out 😃😃

So that's where it gets a little mysterious. Seems like a Windows setting... but also not maybe?

It looks great in a light theme! That's all I can say. Too bad I use dark themes throughout most of the day. 😵

2 Answers 2

2

If you're running a more-upto-date version of Windows, you can modify the settings of the windows-terminal. SSH will actually use the terminal's defined colors.

enter image description here

You can use any predefined scheme... or add a new one, and customize it to your heart's content.

1
  • Ah Windows 11 update. Yeh that'll do it. Lol well glad to at least be given some peace of mind finally it should be taken care of once I complete the transition. Getting sooo close, just need to pin down new system imaging solution & we'll be shreddin. 🤣 Major thanks 👍👍
    – FOSS Guru
    Commented Oct 5, 2023 at 19:33
1

The local terminal is just respecting the remote color commands (other than basic fore/background colors). The colors for stuff like directories from ls are determined per-command on the remote server.

For ls specifically, the default behavior is usually that these colors are set in your LS_COLORS environment variable, which you can check with echo $LS_COLORS. These usually come from dircolors, your profile like ~/.bash_profile or a system-level file like /etc/DIR_COLORS.

Note that each command may have a different way of setting colors. grep usually has a separate list using /etc/GREP_COLORS for example. Different distros may vary as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .