ConsoleDriver.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. //
  2. // ConsoleDriver.cs: Base class for Terminal.Gui ConsoleDriver implementations.
  3. //
  4. using System.Text;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Diagnostics;
  8. using static Terminal.Gui.ColorScheme;
  9. namespace Terminal.Gui;
  10. /// <summary>
  11. /// Base class for Terminal.Gui ConsoleDriver implementations.
  12. /// </summary>
  13. /// <remarks>
  14. /// There are currently four implementations:
  15. /// - <see cref="CursesDriver"/> (for Unix and Mac)
  16. /// - <see cref="WindowsDriver"/>
  17. /// - <see cref="NetDriver"/> that uses the .NET Console API
  18. /// - <see cref="FakeConsole"/> for unit testing.
  19. /// </remarks>
  20. public abstract class ConsoleDriver {
  21. /// <summary>
  22. /// Prepare the driver and set the key and mouse events handlers.
  23. /// </summary>
  24. /// <param name="mainLoop">The main loop.</param>
  25. /// <param name="keyHandler">The handler for ProcessKey</param>
  26. /// <param name="keyDownHandler">The handler for key down events</param>
  27. /// <param name="keyUpHandler">The handler for key up events</param>
  28. /// <param name="mouseHandler">The handler for mouse events</param>
  29. public abstract void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler);
  30. /// <summary>
  31. /// The handler fired when the terminal is resized.
  32. /// </summary>
  33. protected Action TerminalResized;
  34. /// <summary>
  35. /// The number of columns visible in the terminal.
  36. /// </summary>
  37. public virtual int Cols { get; internal set; }
  38. /// <summary>
  39. /// The number of rows visible in the terminal.
  40. /// </summary>
  41. public virtual int Rows { get; internal set; }
  42. /// <summary>
  43. /// The leftmost column in the terminal.
  44. /// </summary>
  45. public virtual int Left { get; internal set; } = 0;
  46. /// <summary>
  47. /// The topmost row in the terminal.
  48. /// </summary>
  49. public virtual int Top { get; internal set; } = 0;
  50. /// <summary>
  51. /// Get the operating system clipboard.
  52. /// </summary>
  53. public IClipboard Clipboard { get; internal set; }
  54. /// <summary>
  55. /// The contents of the application output. The driver outputs this buffer to the terminal when <see cref="UpdateScreen"/>
  56. /// is called.
  57. /// <remarks>
  58. /// The format of the array is rows, columns, and 3 values on the last column: Rune, Attribute and Dirty Flag
  59. /// </remarks>
  60. /// </summary>
  61. //public int [,,] Contents { get; internal set; }
  62. ///// <summary>
  63. ///// The contents of the application output. The driver outputs this buffer to the terminal when <see cref="UpdateScreen"/>
  64. ///// is called.
  65. ///// <remarks>
  66. ///// The format of the array is rows, columns. The first index is the row, the second index is the column.
  67. ///// </remarks>
  68. ///// </summary>
  69. public Cell [,] Contents { get; internal set; }
  70. /// <summary>
  71. /// Initializes the driver
  72. /// </summary>
  73. /// <param name="terminalResized">Method to invoke when the terminal is resized.</param>
  74. public abstract void Init (Action terminalResized);
  75. /// <summary>
  76. /// Gets the column last set by <see cref="Move"/>. <see cref="Col"/> and <see cref="Row"/>
  77. /// are used by <see cref="AddRune(Rune)"/> and <see cref="AddStr"/> to determine where to add content.
  78. /// </summary>
  79. public int Col { get; internal set; }
  80. /// <summary>
  81. /// Gets the row last set by <see cref="Move"/>. <see cref="Col"/> and <see cref="Row"/>
  82. /// are used by <see cref="AddRune(Rune)"/> and <see cref="AddStr"/> to determine where to add content.
  83. /// </summary>
  84. public int Row { get; internal set; }
  85. /// <summary>
  86. /// Updates <see cref="Col"/> and <see cref="Row"/> to the specified column and row in <see cref="Contents"/>.
  87. /// Used by <see cref="AddRune(Rune)"/> and <see cref="AddStr"/> to determine where to add content.
  88. /// </summary>
  89. /// <remarks>
  90. /// <para>
  91. /// This does not move the cursor on the screen, it only updates the internal state of the driver.
  92. /// </para>
  93. /// <para>
  94. /// If <paramref name="col"/> or <paramref name="row"/> are negative or beyond <see cref="Cols"/> and <see cref="Rows"/>,
  95. /// the method still sets those properties.
  96. /// </para>
  97. /// </remarks>
  98. /// <param name="col">Column to move to.</param>
  99. /// <param name="row">Row to move to.</param>
  100. public virtual void Move (int col, int row)
  101. {
  102. Col = col;
  103. Row = row;
  104. }
  105. /// <summary>
  106. /// Tests if the specified rune is supported by the driver.
  107. /// </summary>
  108. /// <param name="rune"></param>
  109. /// <returns><see langword="true"/> if the rune can be properly presented; <see langword="false"/> if the driver
  110. /// does not support displaying this rune.</returns>
  111. public virtual bool IsRuneSupported (Rune rune)
  112. {
  113. return Rune.IsValid (rune.Value);
  114. }
  115. /// <summary>
  116. /// Adds the specified rune to the display at the current cursor position.
  117. /// </summary>
  118. /// <remarks>
  119. /// <para>
  120. /// When the method returns, <see cref="Col"/> will be incremented by the number of columns <paramref name="rune"/> required,
  121. /// even if the new column value is outside of the <see cref="Clip"/> or screen dimensions defined by <see cref="Cols"/>.
  122. /// </para>
  123. /// <para>
  124. /// If <paramref name="rune"/> requires more than one column, and <see cref="Col"/> plus the number of columns needed
  125. /// exceeds the <see cref="Clip"/> or screen dimensions, the default Unicode replacement character (U+FFFD) will be added instead.
  126. /// </para>
  127. /// </remarks>
  128. /// <param name="rune">Rune to add.</param>
  129. public void AddRune (Rune rune)
  130. {
  131. int runeWidth = -1;
  132. var validLocation = IsValidLocation (Col, Row);
  133. if (validLocation) {
  134. rune = rune.MakePrintable ();
  135. runeWidth = rune.GetColumns ();
  136. if (runeWidth == 0 && rune.IsCombiningMark () && Col > 0) {
  137. // This is a combining character, and we are not at the beginning of the line.
  138. // TODO: Remove hard-coded [0] once combining pairs is supported
  139. // Convert Runes to string and concatenate
  140. string combined = Contents [Row, Col - 1].Runes [0].ToString () + rune.ToString ();
  141. // Normalize to Form C (Canonical Composition)
  142. string normalized = combined.Normalize (NormalizationForm.FormC);
  143. Contents [Row, Col - 1].Runes = new List<Rune> { (Rune)normalized [0] }; ;
  144. Contents [Row, Col - 1].Attribute = CurrentAttribute;
  145. Contents [Row, Col - 1].IsDirty = true;
  146. //Col--;
  147. } else {
  148. Contents [Row, Col].Attribute = CurrentAttribute;
  149. Contents [Row, Col].IsDirty = true;
  150. if (Col > 0) {
  151. // Check if cell to left has a wide glyph
  152. if (Contents [Row, Col - 1].Runes [0].GetColumns () > 1) {
  153. // Invalidate cell to left
  154. Contents [Row, Col - 1].Runes = new List<Rune> { Rune.ReplacementChar };
  155. Contents [Row, Col - 1].IsDirty = true;
  156. }
  157. }
  158. if (runeWidth < 1) {
  159. Contents [Row, Col].Runes = new List<Rune> { Rune.ReplacementChar };
  160. } else if (runeWidth == 1) {
  161. Contents [Row, Col].Runes = new List<Rune> { rune };
  162. if (Col < Clip.Right - 1) {
  163. Contents [Row, Col + 1].IsDirty = true;
  164. }
  165. } else if (runeWidth == 2) {
  166. if (Col == Clip.Right - 1) {
  167. // We're at the right edge of the clip, so we can't display a wide character.
  168. // TODO: Figure out if it is better to show a replacement character or ' '
  169. Contents [Row, Col].Runes = new List<Rune> { Rune.ReplacementChar };
  170. } else {
  171. Contents [Row, Col].Runes = new List<Rune> { rune };
  172. if (Col < Clip.Right - 1) {
  173. // Invalidate cell to right so that it doesn't get drawn
  174. // TODO: Figure out if it is better to show a replacement character or ' '
  175. Contents [Row, Col + 1].Runes = new List<Rune> { Rune.ReplacementChar };
  176. Contents [Row, Col + 1].IsDirty = true;
  177. }
  178. }
  179. } else {
  180. // This is a non-spacing character, so we don't need to do anything
  181. Contents [Row, Col].Runes = new List<Rune> { (Rune)' ' };
  182. Contents [Row, Col].IsDirty = false;
  183. }
  184. _dirtyLines [Row] = true;
  185. }
  186. }
  187. if (runeWidth is < 0 or > 0) {
  188. Col++;
  189. }
  190. if (runeWidth > 1) {
  191. Debug.Assert (runeWidth <= 2);
  192. if (validLocation && Col < Clip.Right) {
  193. // This is a double-width character, and we are not at the end of the line.
  194. // Col now points to the second column of the character. Ensure it doesn't
  195. // Get rendered.
  196. Contents [Row, Col].IsDirty = false;
  197. Contents [Row, Col].Attribute = CurrentAttribute;
  198. // TODO: Determine if we should wipe this out (for now now)
  199. //Contents [Row, Col].Runes [0] = (Rune)' ';
  200. }
  201. Col++;
  202. }
  203. }
  204. /// <summary>
  205. /// Adds the specified <see langword="char"/> to the display at the current cursor position. This method
  206. /// is a convenience method that calls <see cref="AddRune(Rune)"/> with the <see cref="Rune"/> constructor.
  207. /// </summary>
  208. /// <param name="c">Character to add.</param>
  209. public void AddRune (char c) => AddRune (new Rune (c));
  210. /// <summary>
  211. /// Adds the <paramref name="str"/> to the display at the cursor position.
  212. /// </summary>
  213. /// <remarks>
  214. /// <para>
  215. /// When the method returns, <see cref="Col"/> will be incremented by the number of columns <paramref name="str"/> required,
  216. /// unless the new column value is outside of the <see cref="Clip"/> or screen dimensions defined by <see cref="Cols"/>.
  217. /// </para>
  218. /// <para>
  219. /// If <paramref name="str"/> requires more columns than are available, the output will be clipped.
  220. /// </para>
  221. /// </remarks>
  222. /// <param name="str">String.</param>
  223. public void AddStr (string str)
  224. {
  225. foreach (var rune in str.EnumerateRunes ()) {
  226. AddRune (rune);
  227. }
  228. }
  229. Rect _clip;
  230. /// <summary>
  231. /// Tests whether the specified coordinate are valid for drawing.
  232. /// </summary>
  233. /// <param name="col">The column.</param>
  234. /// <param name="row">The row.</param>
  235. /// <returns><see langword="false"/> if the coordinate is outside of the
  236. /// screen bounds or outside of <see cref="Clip"/>. <see langword="true"/> otherwise.</returns>
  237. public bool IsValidLocation (int col, int row) =>
  238. col >= 0 && row >= 0 &&
  239. col < Cols && row < Rows &&
  240. Clip.Contains (col, row);
  241. /// <summary>
  242. /// Gets or sets the clip rectangle that <see cref="AddRune(Rune)"/> and <see cref="AddStr(string)"/> are
  243. /// subject to.
  244. /// </summary>
  245. /// <value>The rectangle describing the bounds of <see cref="Clip"/>.</value>
  246. public Rect Clip {
  247. get => _clip;
  248. set => _clip = value;
  249. }
  250. /// <summary>
  251. /// Updates the screen to reflect all the changes that have been done to the display buffer
  252. /// </summary>
  253. public abstract void Refresh ();
  254. /// <summary>
  255. /// Sets the position of the terminal cursor to <see cref="Col"/> and <see cref="Row"/>.
  256. /// </summary>
  257. public abstract void UpdateCursor ();
  258. /// <summary>
  259. /// Gets the terminal cursor visibility.
  260. /// </summary>
  261. /// <param name="visibility">The current <see cref="CursorVisibility"/></param>
  262. /// <returns><see langword="true"/> upon success</returns>
  263. public abstract bool GetCursorVisibility (out CursorVisibility visibility);
  264. /// <summary>
  265. /// Sets the terminal cursor visibility.
  266. /// </summary>
  267. /// <param name="visibility">The wished <see cref="CursorVisibility"/></param>
  268. /// <returns><see langword="true"/> upon success</returns>
  269. public abstract bool SetCursorVisibility (CursorVisibility visibility);
  270. /// <summary>
  271. /// Determines if the terminal cursor should be visible or not and sets it accordingly.
  272. /// </summary>
  273. /// <returns><see langword="true"/> upon success</returns>
  274. public abstract bool EnsureCursorVisibility ();
  275. // As performance is a concern, we keep track of the dirty lines and only refresh those.
  276. // This is in addition to the dirty flag on each cell.
  277. internal bool [] _dirtyLines;
  278. /// <summary>
  279. /// Clears the <see cref="Contents"/> of the driver.
  280. /// </summary>
  281. public void ClearContents ()
  282. {
  283. // TODO: This method is really "Clear Contents" now and should not be abstract (or virtual)
  284. Contents = new Cell [Rows, Cols];
  285. Clip = new Rect (0, 0, Cols, Rows);
  286. _dirtyLines = new bool [Rows];
  287. lock (Contents) {
  288. // Can raise an exception while is still resizing.
  289. try {
  290. for (var row = 0; row < Rows; row++) {
  291. for (var c = 0; c < Cols; c++) {
  292. Contents [row, c] = new Cell () {
  293. Runes = new List<Rune> { (Rune)' ' },
  294. Attribute = new Attribute (Color.White, Color.Black),
  295. IsDirty = true
  296. };
  297. _dirtyLines [row] = true;
  298. }
  299. }
  300. } catch (IndexOutOfRangeException) { }
  301. }
  302. }
  303. /// <summary>
  304. /// Redraws the physical screen with the contents that have been queued up via any of the printing commands.
  305. /// </summary>
  306. public abstract void UpdateScreen ();
  307. #region Color Handling
  308. /// <summary>
  309. /// Gets whether the <see cref="ConsoleDriver"/> supports TrueColor output.
  310. /// </summary>
  311. public virtual bool SupportsTrueColor { get => true; }
  312. bool _force16Colors = false;
  313. // TODO: Make this a ConfiguationManager setting on Application
  314. /// <summary>
  315. /// Gets or sets whether the <see cref="ConsoleDriver"/> should use 16 colors instead of the default TrueColors.
  316. /// </summary>
  317. /// <remarks>
  318. /// Will be forced to <see langword="true"/> if <see cref="ConsoleDriver.SupportsTrueColor"/> is <see langword="false"/>, indicating
  319. /// that the <see cref="ConsoleDriver"/> cannot support TrueColor.
  320. /// </remarks>
  321. public virtual bool Force16Colors {
  322. get => _force16Colors || !SupportsTrueColor;
  323. set {
  324. _force16Colors = (value || !SupportsTrueColor);
  325. }
  326. }
  327. Attribute _currentAttribute;
  328. /// <summary>
  329. /// The <see cref="Attribute"/> that will be used for the next <see cref="AddRune(Rune)"/> or <see cref="AddStr"/> call.
  330. /// </summary>
  331. public Attribute CurrentAttribute {
  332. get => _currentAttribute;
  333. set {
  334. if (value is { Initialized: false, HasValidColors: true } && Application.Driver != null) {
  335. _currentAttribute = Application.Driver.MakeAttribute (value.Foreground, value.Background);
  336. return;
  337. }
  338. if (!value.Initialized) Debug.WriteLine ("ConsoleDriver.CurrentAttribute: Attributes must be initialized before use.");
  339. _currentAttribute = value;
  340. }
  341. }
  342. /// <summary>
  343. /// Selects the specified attribute as the attribute to use for future calls to AddRune and AddString.
  344. /// </summary>
  345. /// <remarks>
  346. /// Implementations should call <c>base.SetAttribute(c)</c>.
  347. /// </remarks>
  348. /// <param name="c">C.</param>
  349. public Attribute SetAttribute (Attribute c)
  350. {
  351. var prevAttribute = CurrentAttribute;
  352. CurrentAttribute = c;
  353. return prevAttribute;
  354. }
  355. /// <summary>
  356. /// Make the attribute for the foreground and background colors.
  357. /// </summary>
  358. /// <param name="fore">Foreground.</param>
  359. /// <param name="back">Background.</param>
  360. /// <returns></returns>
  361. public virtual Attribute MakeAttribute (Color fore, Color back)
  362. {
  363. return MakeColor (fore, back);
  364. }
  365. /// <summary>
  366. /// Gets the foreground and background colors based on a platform-dependent color value.
  367. /// </summary>
  368. /// <param name="value">The platform-dependent color value.</param>
  369. /// <param name="foreground">The foreground.</param>
  370. /// <param name="background">The background.</param>
  371. internal abstract void GetColors (int value, out Color foreground, out Color background);
  372. /// <summary>
  373. /// Gets the current <see cref="Attribute"/>.
  374. /// </summary>
  375. /// <returns>The current attribute.</returns>
  376. public Attribute GetAttribute () => CurrentAttribute;
  377. /// <summary>
  378. /// Makes an <see cref="Attribute"/>.
  379. /// </summary>
  380. /// <param name="foreground">The foreground color.</param>
  381. /// <param name="background">The background color.</param>
  382. /// <returns>The attribute for the foreground and background colors.</returns>
  383. public abstract Attribute MakeColor (Color foreground, Color background);
  384. /// <summary>
  385. /// Ensures all <see cref="Attribute"/>s in <see cref="Colors.ColorSchemes"/> are correctly
  386. /// initialized by the driver.
  387. /// </summary>
  388. public void InitializeColorSchemes ()
  389. {
  390. // Ensure all Attributes are initialized by the driver
  391. foreach (var s in Colors.ColorSchemes) {
  392. s.Value.Initialize ();
  393. }
  394. }
  395. #endregion
  396. /// <summary>
  397. /// Enables diagnostic functions
  398. /// </summary>
  399. [Flags]
  400. public enum DiagnosticFlags : uint {
  401. /// <summary>
  402. /// All diagnostics off
  403. /// </summary>
  404. Off = 0b_0000_0000,
  405. /// <summary>
  406. /// When enabled, <see cref="Frame.OnDrawFrames"/> will draw a
  407. /// ruler in the frame for any side with a padding value greater than 0.
  408. /// </summary>
  409. FrameRuler = 0b_0000_0001,
  410. /// <summary>
  411. /// When enabled, <see cref="Frame.OnDrawFrames"/> will draw a
  412. /// 'L', 'R', 'T', and 'B' when clearing <see cref="Thickness"/>'s instead of ' '.
  413. /// </summary>
  414. FramePadding = 0b_0000_0010,
  415. }
  416. /// <summary>
  417. /// Set flags to enable/disable <see cref="ConsoleDriver"/> diagnostics.
  418. /// </summary>
  419. public static DiagnosticFlags Diagnostics { get; set; }
  420. /// <summary>
  421. /// Suspends the application (e.g. on Linux via SIGTSTP) and upon resume, resets the console driver.
  422. /// </summary>
  423. /// <remarks>This is only implemented in <see cref="CursesDriver"/>.</remarks>
  424. public abstract void Suspend ();
  425. /// <summary>
  426. /// Simulates a key press.
  427. /// </summary>
  428. /// <param name="keyChar">The key character.</param>
  429. /// <param name="key">The key.</param>
  430. /// <param name="shift">If <see langword="true"/> simulates the Shift key being pressed.</param>
  431. /// <param name="alt">If <see langword="true"/> simulates the Alt key being pressed.</param>
  432. /// <param name="ctrl">If <see langword="true"/> simulates the Ctrl key being pressed.</param>
  433. public abstract void SendKeys (char keyChar, ConsoleKey key, bool shift, bool alt, bool ctrl);
  434. // TODO: Move FillRect to ./Drawing
  435. /// <summary>
  436. /// Fills the specified rectangle with the specified rune.
  437. /// </summary>
  438. /// <param name="rect"></param>
  439. /// <param name="rune"></param>
  440. public void FillRect (Rect rect, Rune rune = default)
  441. {
  442. for (var r = rect.Y; r < rect.Y + rect.Height; r++) {
  443. for (var c = rect.X; c < rect.X + rect.Width; c++) {
  444. Application.Driver.Move (c, r);
  445. Application.Driver.AddRune (rune == default ? new Rune (' ') : rune);
  446. }
  447. }
  448. }
  449. /// <summary>
  450. /// Fills the specified rectangle with the specified <see langword="char"/>. This method
  451. /// is a convenience method that calls <see cref="FillRect(Rect, Rune)"/>.
  452. /// </summary>
  453. /// <param name="rect"></param>
  454. /// <param name="c"></param>
  455. public void FillRect (Rect rect, char c) => FillRect (rect, new Rune (c));
  456. /// <summary>
  457. /// Ends the execution of the console driver.
  458. /// </summary>
  459. public abstract void End ();
  460. /// <summary>
  461. /// Returns the name of the driver and relevant library version information.
  462. /// </summary>
  463. /// <returns></returns>
  464. public virtual string GetVersionInfo () => GetType ().Name;
  465. }
  466. /// <summary>
  467. /// Terminal Cursor Visibility settings.
  468. /// </summary>
  469. /// <remarks>
  470. /// Hex value are set as 0xAABBCCDD where :
  471. ///
  472. /// AA stand for the TERMINFO DECSUSR parameter value to be used under Linux and MacOS
  473. /// BB stand for the NCurses curs_set parameter value to be used under Linux and MacOS
  474. /// CC stand for the CONSOLE_CURSOR_INFO.bVisible parameter value to be used under Windows
  475. /// DD stand for the CONSOLE_CURSOR_INFO.dwSize parameter value to be used under Windows
  476. ///</remarks>
  477. public enum CursorVisibility {
  478. /// <summary>
  479. /// Cursor caret has default
  480. /// </summary>
  481. /// <remarks>Works under Xterm-like terminal otherwise this is equivalent to <see ref="Underscore"/>. This default directly depends of the XTerm user configuration settings so it could be Block, I-Beam, Underline with possible blinking.</remarks>
  482. Default = 0x00010119,
  483. /// <summary>
  484. /// Cursor caret is hidden
  485. /// </summary>
  486. Invisible = 0x03000019,
  487. /// <summary>
  488. /// Cursor caret is normally shown as a blinking underline bar _
  489. /// </summary>
  490. Underline = 0x03010119,
  491. /// <summary>
  492. /// Cursor caret is normally shown as a underline bar _
  493. /// </summary>
  494. /// <remarks>Under Windows, this is equivalent to <see ref="UnderscoreBlinking"/></remarks>
  495. UnderlineFix = 0x04010119,
  496. /// <summary>
  497. /// Cursor caret is displayed a blinking vertical bar |
  498. /// </summary>
  499. /// <remarks>Works under Xterm-like terminal otherwise this is equivalent to <see ref="Underscore"/></remarks>
  500. Vertical = 0x05010119,
  501. /// <summary>
  502. /// Cursor caret is displayed a blinking vertical bar |
  503. /// </summary>
  504. /// <remarks>Works under Xterm-like terminal otherwise this is equivalent to <see ref="Underscore"/></remarks>
  505. VerticalFix = 0x06010119,
  506. /// <summary>
  507. /// Cursor caret is displayed as a blinking block ▉
  508. /// </summary>
  509. Box = 0x01020164,
  510. /// <summary>
  511. /// Cursor caret is displayed a block ▉
  512. /// </summary>
  513. /// <remarks>Works under Xterm-like terminal otherwise this is equivalent to <see ref="Block"/></remarks>
  514. BoxFix = 0x02020164,
  515. }