es.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package aes
  2. const (
  3. KeyESC = '\x1B'
  4. )
  5. const (
  6. // Start.
  7. ESC = "\x1B"
  8. // Control sequence introducer.
  9. CSI = ESC+"["
  10. // Device control string.
  11. DCS = ESC+"P"
  12. // Operating system command.
  13. OSC = ESC+"]"
  14. )
  15. // Special control sequences.
  16. const (
  17. BEL = "\a"
  18. BS = "\b"
  19. HT = "\t"
  20. LF = "\n"
  21. VT = "\v"
  22. FF = "\f"
  23. CR = "\r"
  24. DEL = "\x7F"
  25. )
  26. // Erasing control sequences.
  27. // Names are self describing.
  28. const (
  29. EraseInDisplay = CSI+"J"
  30. EraseFromCursorToEndOfScreen = CSI+"0J"
  31. EraseFromCursorToBeginOfScreen = CSI+"1J"
  32. EraseEntireScreen = CSI+"2J"
  33. EraseSavedLines = CSI+"3J"
  34. EraseInLine = CSI+"K"
  35. EraseFromCursorToEndOfLine = CSI+"0K"
  36. EraseFromStartOfLineToCursor = CSI+"1K"
  37. EraseEntireLine = CSI+"2K"
  38. )
  39. // Cursor control sequences.
  40. // Any that ends with the "Format" means that
  41. // the format is meant to be used via fmt.Sprintf
  42. // or any fitting function to provide arguments
  43. // into the escape code.
  44. const (
  45. MoveCursorHome = CSI+"H"
  46. // Line, column (both int).
  47. MoveCursorToFormat = CSI+"%d;%dH"
  48. SecondaryMoveCursorToFormat = CSI+"%d;%df"
  49. MoveCursorUpFormat = CSI+"%dA"
  50. MoveCursorDownFormat = CSI+"%dB"
  51. MoveCursorRightFormat = CSI+"%dC"
  52. MoveCursorLeftFormat = CSI+"%dD"
  53. MoveCursorToBeginOfNextLineDownFormat = CSI+"%dE"
  54. MoveCursorToBeginOfPrevLineUpFormat = CSI+"%dF"
  55. MoveCursorToColumnFormat = CSI+"%dG"
  56. RequestCursorPositionReportFormat =CSI+"%d;%dR"
  57. RequestCursorPosition = CSI+"6n"
  58. SaveCursorPositionDEC = ESC+" 7"
  59. UndoCursorPositionDEC = ESC+" 8"
  60. SaveCursorPositionSCO = CSI+"s"
  61. UndoCursorPositionSCO = CSI+"u"
  62. )
  63. // Common private modes.
  64. const (
  65. MakeCursorInvisible = CSI+"?25l"
  66. MakeCursorVisible = CSI+"?25h"
  67. UndoScreen = CSI+"?47l"
  68. SaveScreen = CSI+"?47h"
  69. EnableAltBuffer = CSI+"?1049h"
  70. DisableAltBuffer = CSI+"?1049l"
  71. )