vezel-dev / cathode

A terminal-centric replacement for the .NET console APIs.
https://docs.vezel.dev/cathode
BSD Zero Clause License
91 stars 7 forks source link

Support cancellation in `ReadLine`/`ReadLineAsync` methods (.NET 7) #49

Closed alexrp closed 2 years ago

alexrp commented 2 years ago

Depends on:

Blocked on: dotnet/runtime#20824

alexrp commented 2 years ago

https://github.com/alexrp/system-terminal/blob/acc9de6d5a63025bb9278b4817c9e265513b3089/src/core/IO/TerminalReader.cs#L81-L95

alexrp commented 2 years ago

(It seems like only ReadLineAsync will get a CancellationToken overload.)

alexrp commented 2 years ago

Need to determine what to do about ReadLine...

alexrp commented 2 years ago

It might make the most sense to just not support cancellation in synchronous methods. That seems to be the norm throughout the BCL.