AnsiEscapeSequenceResponse.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Describes a finished ANSI received from the console.
  5. /// </summary>
  6. public class AnsiEscapeSequenceResponse
  7. {
  8. /// <summary>
  9. /// Error received from e.g. see
  10. /// <see>
  11. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Request</cref>
  12. /// </see>
  13. /// </summary>
  14. public required string Error { get; init; }
  15. /// <summary>
  16. /// Response received from e.g. see
  17. /// <see>
  18. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Request</cref>
  19. /// </see>
  20. /// .
  21. /// </summary>
  22. public required string Response { get; init; }
  23. /// <summary>
  24. /// <para>
  25. /// The terminator that uniquely identifies the type of response as responded
  26. /// by the console. e.g. for
  27. /// <see>
  28. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Request</cref>
  29. /// </see>
  30. /// the terminator is
  31. /// <see>
  32. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Terminator</cref>
  33. /// </see>
  34. /// </para>
  35. /// <para>
  36. /// The received terminator must match to the terminator sent by the request.
  37. /// </para>
  38. /// </summary>
  39. public required string Terminator { get; init; }
  40. /// <summary>
  41. /// The value expected in the response e.g.
  42. /// <see>
  43. /// <cref>EscSeqUtils.CSI_ReportTerminalSizeInChars.Value</cref>
  44. /// </see>
  45. /// which will have a 't' as terminator but also other different request may return the same terminator with a
  46. /// different value.
  47. /// </summary>
  48. public string? Value { get; init; }
  49. }