Skip to content

Commit 8568533

Browse files
author
Marek Majkowski
committed
bug24113 merged into default
2 parents 2600283 + f1204b5 commit 8568533

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

projects/examples/wcf/Test/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static void Main(string[] args)
100100
Util.WriteLine(ConsoleColor.Magenta, "\t{0}\n\t{1}", e.GetType().Name, e.Message);
101101
Util.WriteLine(ConsoleColor.Green, e.StackTrace);
102102
failed++;
103+
Environment.ExitCode = -1;
103104
}
104105
}
105106
TimeSpan duration = DateTime.Now.Subtract(started);
@@ -140,7 +141,7 @@ static int Percent(int a, params int[] values)
140141

141142
static void WriteWholeLine()
142143
{
143-
int i = Console.WindowWidth;
144+
int i = ConsoleWidth();
144145
while (i > 1)
145146
{
146147
Console.Write(" ");
@@ -157,7 +158,7 @@ static void WriteWholeLine(string format, params object[] args)
157158
static void WriteWholeLine(string o)
158159
{
159160
Console.Write(o);
160-
int i = Console.WindowWidth;
161+
int i = ConsoleWidth();
161162
while (i > o.Length+1)
162163
{
163164
Console.Write(" ");
@@ -166,5 +167,10 @@ static void WriteWholeLine(string o)
166167
Console.Write("\n");
167168

168169
}
170+
171+
static int ConsoleWidth()
172+
{
173+
return Environment.GetEnvironmentVariable("TERM") == null ? Console.WindowWidth : 80;
174+
}
169175
}
170176
}

0 commit comments

Comments
 (0)