diff --git a/src/Spectre.Console.Ansi/AnsiWriter.cs b/src/Spectre.Console.Ansi/AnsiWriter.cs index 3140cd7d..d06c6589 100644 --- a/src/Spectre.Console.Ansi/AnsiWriter.cs +++ b/src/Spectre.Console.Ansi/AnsiWriter.cs @@ -299,7 +299,7 @@ public sealed class AnsiWriter /// /// This control function moves the cursor to the specified line and column (1-indexed) - /// by emitting CUP. + /// by emitting CSI row;column H. /// /// /// See . @@ -314,7 +314,7 @@ public sealed class AnsiWriter } /// - /// Moves the cursor to position 1,1 (top left corner) by emitting CUP. + /// Moves the cursor to position 1,1 (top left corner) by emitting CSI H. /// /// /// See . @@ -327,7 +327,7 @@ public sealed class AnsiWriter } /// - /// Moves the cursor up a specified number of lines in the same column by emitting CUU. + /// Moves the cursor up a specified number of lines in the same column by emitting CSI n A. /// The cursor stops at the top margin. /// If the cursor is already above the top margin, then the cursor stops at the top line. /// @@ -344,7 +344,7 @@ public sealed class AnsiWriter /// /// This control function moves the cursor down a specified number of lines in the same column - /// by emitting CUD. + /// by emitting CSI n B. /// The cursor stops at the bottom margin. /// If the cursor is already below the bottom margin, then the cursor stops at the bottom line. /// @@ -361,7 +361,7 @@ public sealed class AnsiWriter /// /// This control function moves the cursor to the right by a specified number of columns - /// by emitting CUF. + /// by emitting CSI n C. /// The cursor stops at the right border of the page. /// /// @@ -377,7 +377,7 @@ public sealed class AnsiWriter /// /// This control function moves the cursor to the left by a specified number of columns - /// by emitting CUB. + /// by emitting CSI n D. /// The cursor stops at the left border of the page. /// /// @@ -392,7 +392,7 @@ public sealed class AnsiWriter } /// - /// Shows the cursor by emitting SM(25h). + /// Shows the cursor by emitting CSI ? 25 h. /// /// /// See . @@ -405,7 +405,7 @@ public sealed class AnsiWriter } /// - /// Hides the cursor by emitting RM(25l). + /// Hides the cursor by emitting CSI ? 25 l. /// /// /// See . @@ -418,7 +418,49 @@ public sealed class AnsiWriter } /// - /// Enters the alternative screen buffer by emitting CSI ?1049h. + /// Saves current cursor position for SCO console mode + /// by emitting CSI s + /// + /// + /// See . + /// + /// + public AnsiWriter SaveCursor() + { + WriteCsi("s"); + return this; + } + + /// + /// Moves cursor to the position saved by save cursor command in SCO console mode + /// by emitting CSI u + /// + /// + /// See . + /// + /// + public AnsiWriter RestoreCursor() + { + WriteCsi("u"); + return this; + } + + /// + /// Moves the active position to the n-th character of the active line + /// by emitting CSI n G + /// + /// + /// See . + /// + /// The horizontal position. + public AnsiWriter CursorHorizontalAbsolute(int position) + { + WriteCsi(position, 'G'); + return this; + } + + /// + /// Enters the alternative screen buffer by emitting CSI ? 1049 h. /// /// The same instance so that multiple calls can be chained. public AnsiWriter EnterAltScreen() @@ -428,7 +470,7 @@ public sealed class AnsiWriter } /// - /// Exits the alternative screen buffer by emitting CSI ?1049l. + /// Exits the alternative screen buffer by emitting CSI ? 1049 l. /// /// The same instance so that multiple calls can be chained. public AnsiWriter ExitAltScreen()