Skip to content

Handle exception in System.Console.SetCursorPosition in some environments#3678

Merged
noahfalk merged 1 commit intodotnet:mainfrom
HJLeee:fix_term
Mar 8, 2023
Merged

Handle exception in System.Console.SetCursorPosition in some environments#3678
noahfalk merged 1 commit intodotnet:mainfrom
HJLeee:fix_term

Conversation

@HJLeee
Copy link
Copy Markdown
Contributor

@HJLeee HJLeee commented Feb 21, 2023

Apply feedback.
#3635 (comment)

Now it looks like the below when System.Console.SetCursorPosition(Int32 left, Int32 top) throws exception.

�[?1h�=No profile or providers specified, defaulting to trace profile 'cpu-sampling'

Provider Name                           Keywords            Level               Enabled By
Microsoft-DotNETCore-SampleProfiler     0x0000F00000000000  Informational(4)    --profile
Microsoft-Windows-DotNETRuntime         0x00000014C14FCCBD  Informational(4)    --profile

Process        : /usr/bin/dotnet-launcher
Output File    : /tmp/dotnet-launcher_20230222_063808.nettrace



�[6n�[?25l�[6n�[6nRecording trace in progress. Press <Enter> or <Ctrl+C> to exit...

cc/ @gbalykov @noahfalk

…ents

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was -1.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.Internal.Common.Utils.LineRewriter.SystemConsoleLineRewriter()
at Microsoft.Internal.Common.Utils.LineRewriter.RewriteConsoleLine()
at Microsoft.Diagnostics.Tools.Trace.CollectCommandHandler.<>c__DisplayClass6_2.b__4()
at Microsoft.Diagnostics.Tools.Trace.CollectCommandHandler.Collect(CancellationToken ct, IConsole console, Int32 processId, FileInfo output, UInt32 buffersize, String providers, String profile, TraceFileFormat format, TimeSpan duration, String clrevents, String clreventlevel, String name, String diagnosticPort, Boolean showchildio, Boolean resumeRuntime
@HJLeee HJLeee requested a review from a team as a code owner February 21, 2023 21:40
Copy link
Copy Markdown
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@noahfalk
Copy link
Copy Markdown
Member

@dotnet/dotnet-diag in case anyone else wants to take a look

@HJLeee - Thanks for the updated version👍 Are you ready to have this merged?

@HJLeee
Copy link
Copy Markdown
Contributor Author

HJLeee commented Feb 26, 2023

Are you ready to have this merged?

Yes. Please merge this. :)

@HJLeee
Copy link
Copy Markdown
Contributor Author

HJLeee commented Mar 8, 2023

@noahfalk Please let me know anything necessary for merge.

@noahfalk
Copy link
Copy Markdown
Member

noahfalk commented Mar 8, 2023

My apologies I just missed your message. Very sorry about that!

@noahfalk noahfalk merged commit 09d03a8 into dotnet:main Mar 8, 2023
@HJLeee
Copy link
Copy Markdown
Contributor Author

HJLeee commented Mar 8, 2023

Thank you. Have a good day. 👍

@HJLeee HJLeee deleted the fix_term branch March 8, 2023 10:14
HJLeee added a commit to HJLeee/diagnostics that referenced this pull request Jun 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants