Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for bug in System.CommandLine #512

Merged
merged 2 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/dotnet-grpc/Commands/ListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@ public void List()
}

var screen = new ScreenView(consoleRenderer, Console) { Child = table };
screen.Render(new Region(0, 0, System.Console.WindowWidth, System.Console.WindowWidth));
Region region;
try
{
// System.Console.WindowWidth can throw an IOException when runnning without a console attached
region = new Region(0, 0, System.Console.WindowWidth, System.Console.WindowHeight);
shirhatti marked this conversation as resolved.
Show resolved Hide resolved
}
catch (IOException)
{
region = new Region(0, 0, int.MaxValue, int.MaxValue);
}
screen.Child?.Render(consoleRenderer, region);
}
}
}
1 change: 0 additions & 1 deletion test/dotnet-grpc.Tests/ListCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace Grpc.Dotnet.Cli.Tests
public class ListCommandTests : TestBase
{
[Test]
[Ignore("https://github.com/grpc/grpc-dotnet/issues/457")]
public void List_ListsReferences()
{
var currentDir = Directory.GetCurrentDirectory();
Expand Down