Skip to content

Handle case where Host may not return Rows or Cols of screen - #10938

Merged
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:format-table-remoting
Oct 30, 2019
Merged

Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:format-table-remoting

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 29, 2019 •

Copy link
Copy Markdown
Member

PR Summary

In the case where the Host doesn't implement WindowSize so that Rows and Cols can be returned, this is handled locally. But if used over interactive remote session, the remoting layer throws a remoting exception. To handle this case, catch any exception trying to retrieve those values and use a default value so that formatting still renders. The previous fix for this was too specific in the Exceptions caught that it didn't catch a remoting Exception.

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title Handle case where Host may not return Rows or Cols of screen WIP: Handle case where Host may not return Rows or Cols of screen Oct 29, 2019
@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title WIP: Handle case where Host may not return Rows or Cols of screen Handle case where Host may not return Rows or Cols of screen Oct 30, 2019
@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 30, 2019
@anmenaga
Andrew (anmenaga) merged commit 00f41a7 into PowerShell:master Oct 30, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the format-table-remoting branch October 30, 2019 19:57
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants