I use xshell and always set the background to white.
When I start pwsh on Linux, the command forecolor is yellow which is very illegible.
How can I disable the color setting of pwsh?

You could temporary set colors with $host.ui.RawUI
Either that or Set-PSReadLineOption can set the color values used; you can recolor them to something more readable for you or just set any annoying colors back to grey/black.
You can put lines in your $profile script to set these values semi-persistently.
Ideally a light background can be detected automatically and colors adjusted automatically. See https://github.com/PowerShell/PSReadLine/issues/464 for more info.
@vexx32 Thanks.
The Set-PSReadLineOption works.
Most helpful comment
Ideally a light background can be detected automatically and colors adjusted automatically. See https://github.com/PowerShell/PSReadLine/issues/464 for more info.