AnsiEscapeSequence.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Describes an Ansi escape sequence. This is a 'blueprint'. If you
  5. /// want to send the sequence you should instead use <see cref="AnsiEscapeSequenceRequest"/>
  6. /// </summary>
  7. public class AnsiEscapeSequence
  8. {
  9. /// <summary>
  10. /// Request to send e.g. see
  11. /// <see>
  12. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Request</cref>
  13. /// </see>
  14. /// </summary>
  15. public required string Request { get; init; }
  16. /// <summary>
  17. /// <para>
  18. /// The terminator that uniquely identifies the type of response as responded
  19. /// by the console. e.g. for
  20. /// <see>
  21. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Request</cref>
  22. /// </see>
  23. /// the terminator is
  24. /// <see>
  25. /// <cref>EscSeqUtils.CSI_SendDeviceAttributes.Terminator</cref>
  26. /// </see>
  27. /// .
  28. /// </para>
  29. /// <para>
  30. /// After sending a request, the first response with matching terminator will be matched
  31. /// to the oldest outstanding request.
  32. /// </para>
  33. /// </summary>
  34. public required string? Terminator { get; init; }
  35. /// <summary>
  36. /// The value expected in the response e.g.
  37. /// <see>
  38. /// <cref>EscSeqUtils.CSI_ReportTerminalSizeInChars.Value</cref>
  39. /// </see>
  40. /// which will have a 't' as terminator but also other different request may return the same terminator with a
  41. /// different value.
  42. /// </summary>
  43. public string? Value { get; init; }
  44. }