ConsoleDriver.cs 21 KB

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