Don't do bad things with colors in other shells

This commit is contained in:
John Doty 2013-05-21 17:50:48 -07:00
parent 8a429b18ef
commit 5e39695aaa

View file

@ -49,6 +49,8 @@ function prompt
{ {
$ok = $? $ok = $?
if ($Host.Name -eq "ConsoleHost")
{
if (!$global:SolarizedColors) if (!$global:SolarizedColors)
{ {
Set-SolarizedColors -Dark Set-SolarizedColors -Dark
@ -62,6 +64,14 @@ function prompt
$chost = [ConsoleColor]::DarkGreen $chost = [ConsoleColor]::DarkGreen
$cloc = $csym = [ConsoleColor]::DarkCyan $cloc = $csym = [ConsoleColor]::DarkCyan
if (-not $ok) { $csym = [ConsoleColor]::DarkRed; } if (-not $ok) { $csym = [ConsoleColor]::DarkRed; }
}
else
{
$cdelim = [ConsoleColor]::Gray
$chost = [ConsoleColor]::Green
$cloc = $csym = [ConsoleColor]::Gray
if (-not $ok) { $csym = [ConsoleColor]::Red; }
}
write-host "$([char]0x0A7) " -n -f $csym write-host "$([char]0x0A7) " -n -f $csym
write-host ([net.dns]::GetHostName()) -n -f $chost write-host ([net.dns]::GetHostName()) -n -f $chost