Fixes #2305. Improves the handling of escape sequence. (#2375)

* Changed ansi esc sequence used on exit.

* Changed ansi esc sequence used on exit.

* Improves HeightAsBuffer although currently only works on Windows.

* Fixes #2267. Toplevel.EnsureVisibleBounds throws an exception if border is null.

* Changing comment as requested.

* Fixes indentation.

* Seems not needed for now, maybe some update, comment for now.

* Renamed HeightAsBuffer to EnableConsoleScrolling and made it obsolete.

* Add comment on remarks for EnableConsoleScrolling.

* merged @bdisp's EnableConsoleScrolling PR

* Fixes buffer for Windows Terminal.

* Fixes issue in Windows Terminal on resizing causing some lines not be drawing after exceptions.

* merge #9

* merged #9

* use ESC [ ? 1047

* Tweaks with new esc codes

* Fixed curses driver to not nuke scroll buffer and to resize properly

* merge

* Cleand up netdriver escape codes

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed merge issue and  spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed  build error

* removed old comments

* Resolving merge conflicts.

* Ensuring reset the EnableConsoleScrolling.

* Changing from HeightAsBuffer to EnableConsoleScrolling.

* Done requested changes.

* Reformatting.

* Rename to EscSeqReqStatus.

* Removing Console.Out.Flush ();

---------

Co-authored-by: Charlie Kindel <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
This commit is contained in:
BDisp
2023-02-25 22:30:44 +00:00
committed by GitHub
parent ed27696b9e
commit 1d2dc40c8a
24 changed files with 3425 additions and 2313 deletions

View File

@@ -171,7 +171,7 @@ namespace Terminal.Gui.DriverTests {
// MockDriver will still be 120x40
wasTerminalResized = false;
Application.HeightAsBuffer = true;
Application.EnableConsoleScrolling = true;
driver.SetWindowSize (40, 20);
Assert.Equal (120, Application.Driver.Cols);
Assert.Equal (40, Application.Driver.Rows);
@@ -186,12 +186,12 @@ namespace Terminal.Gui.DriverTests {
[Theory]
[InlineData (typeof (FakeDriver))]
public void HeightAsBuffer_Is_False_Left_And_Top_Is_Always_Zero (Type driverType)
public void EnableConsoleScrolling_Is_False_Left_And_Top_Is_Always_Zero (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Assert.False (Application.HeightAsBuffer);
Assert.False (Application.EnableConsoleScrolling);
Assert.Equal (0, Console.WindowLeft);
Assert.Equal (0, Console.WindowTop);
@@ -204,13 +204,13 @@ namespace Terminal.Gui.DriverTests {
[Theory]
[InlineData (typeof (FakeDriver))]
public void HeightAsBuffer_Is_True_Left_Cannot_Be_Greater_Than_WindowWidth (Type driverType)
public void EnableConsoleScrolling_Is_True_Left_Cannot_Be_Greater_Than_WindowWidth (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Application.HeightAsBuffer = true;
Assert.True (Application.HeightAsBuffer);
Application.EnableConsoleScrolling = true;
Assert.True (Application.EnableConsoleScrolling);
driver.SetWindowPosition (81, 25);
Assert.Equal (0, Console.WindowLeft);
@@ -221,13 +221,13 @@ namespace Terminal.Gui.DriverTests {
[Theory]
[InlineData (typeof (FakeDriver))]
public void HeightAsBuffer_Is_True_Left_Cannot_Be_Greater_Than_BufferWidth_Minus_WindowWidth (Type driverType)
public void EnableConsoleScrolling_Is_True_Left_Cannot_Be_Greater_Than_BufferWidth_Minus_WindowWidth (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Application.HeightAsBuffer = true;
Assert.True (Application.HeightAsBuffer);
Application.EnableConsoleScrolling = true;
Assert.True (Application.EnableConsoleScrolling);
driver.SetWindowPosition (81, 25);
Assert.Equal (0, Console.WindowLeft);
@@ -261,13 +261,13 @@ namespace Terminal.Gui.DriverTests {
[Theory]
[InlineData (typeof (FakeDriver))]
public void HeightAsBuffer_Is_True_Top_Cannot_Be_Greater_Than_WindowHeight (Type driverType)
public void EnableConsoleScrolling_Is_True_Top_Cannot_Be_Greater_Than_WindowHeight (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Application.HeightAsBuffer = true;
Assert.True (Application.HeightAsBuffer);
Application.EnableConsoleScrolling = true;
Assert.True (Application.EnableConsoleScrolling);
driver.SetWindowPosition (80, 26);
Assert.Equal (0, Console.WindowLeft);
@@ -278,13 +278,13 @@ namespace Terminal.Gui.DriverTests {
[Theory]
[InlineData (typeof (FakeDriver))]
public void HeightAsBuffer_Is_True_Top_Cannot_Be_Greater_Than_BufferHeight_Minus_WindowHeight (Type driverType)
public void EnableConsoleScrolling_Is_True_Top_Cannot_Be_Greater_Than_BufferHeight_Minus_WindowHeight (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Application.HeightAsBuffer = true;
Assert.True (Application.HeightAsBuffer);
Application.EnableConsoleScrolling = true;
Assert.True (Application.EnableConsoleScrolling);
driver.SetWindowPosition (80, 26);
Assert.Equal (0, Console.WindowLeft);