Browse Source

Merge branch 'develop'

Tigger Kindel 2 years ago
parent
commit
ef18a3862f

+ 25 - 0
.dockerignore

@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 2 - 2
.github/workflows/dotnet-core.yml

@@ -15,9 +15,9 @@ jobs:
     - uses: actions/checkout@v3
 
     - name: Setup .NET Core
-      uses: actions/setup-dotnet@v3.0.3
+      uses: actions/setup-dotnet@v3
       with:
-        dotnet-version: 6.0.100
+        dotnet-version: 7.0
 
     - name: Install dependencies
       run: |

+ 4 - 4
.github/workflows/publish.yml

@@ -16,12 +16,12 @@ jobs:
         fetch-depth: 0 #fetch-depth is needed for GitVersion
 
     - name: Install and calculate the new version with GitVersion 
-      uses: gittools/actions/gitversion/setup@v0.10.2
+      uses: gittools/actions/gitversion/setup@v0
       with:
         versionSpec: 5.x
 
     - name: Determine Version
-      uses: gittools/actions/gitversion/execute@v0.10.2
+      uses: gittools/actions/gitversion/execute@v0
       id: gitversion # step id used as reference for output values
 
     - name: Display GitVersion outputs
@@ -30,9 +30,9 @@ jobs:
         echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
 
     - name: Setup dotnet
-      uses: actions/setup-dotnet@v3.0.3
+      uses: actions/setup-dotnet@v3
       with:
-        dotnet-version: 6.0.100
+        dotnet-version: 7.0
 
     - name: Install dependencies
       run: dotnet restore

+ 1 - 0
README.md

@@ -58,6 +58,7 @@ descriptors. Most classes are safe for threading.
 * **[Reactive Example](https://github.com/gui-cs/Terminal.Gui/tree/master/ReactiveExample)** - A sample app that shows how to use `System.Reactive` and `ReactiveUI` with `Terminal.Gui`. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI `WhenAnyValue` syntax and [Pharmacist](https://github.com/reactiveui/pharmacist) — a tool that converts all events in a NuGet package into observable wrappers.
 * **[PowerShell's `Out-ConsoleGridView`](https://github.com/PowerShell/GraphicalTools)** - `OCGV` sends the output from a command to  an interactive table. 
 * **[PoshRedisViewer](https://github.com/En3Tho/PoshRedisViewer)** - A compact Redis viewer module for PowerShell written in F# and Gui.cs
+* **[PoshDotnetDumpAnalyzeViewer](https://github.com/En3Tho/PoshDotnetDumpAnalyzeViewer)** - dotnet-dump UI module for PowerShell powered by Gui.cs
 * **[TerminalGuiDesigner](https://github.com/tznind/TerminalGuiDesigner)** - Cross platform view designer for building Terminal.Gui applications.
 
 See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured. The [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html) provides insight into core concepts.

+ 2 - 2
ReactiveExample/ReactiveExample.csproj

@@ -11,8 +11,8 @@
     <InformationalVersion>1.10.1+6.Branch.main.Sha.f7ee66ddbf8dbcfb0d96af7d63789879091670ec</InformationalVersion>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="ReactiveUI.Fody" Version="18.4.44" />
-    <PackageReference Include="ReactiveUI" Version="18.4.44" />
+    <PackageReference Include="ReactiveUI.Fody" Version="19.2.1" />
+    <PackageReference Include="ReactiveUI" Version="19.2.1" />
     <PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.2.3" PrivateAssets="all" />
   </ItemGroup>
   <ItemGroup>

+ 18 - 2
Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs

@@ -83,8 +83,24 @@ namespace Unix.Terminal {
 		static void LoadMethods ()
 		{
 			var libs = UnmanagedLibrary.IsMacOSPlatform ? new string [] { "libncurses.dylib" } : new string [] { "libncursesw.so.6", "libncursesw.so.5" };
-			curses_library = new UnmanagedLibrary (libs, false);
-			methods = new NativeMethods (curses_library);
+			var attempts = 1;
+			while (true) {
+				try {
+					curses_library = new UnmanagedLibrary (libs, false);
+					methods = new NativeMethods (curses_library);
+					break;
+				} catch (Exception ex) {
+
+					if (attempts == 1) {
+						attempts++;
+						if (Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem.Contains ("opensuse")) {
+							libs [0] = "libncursesw.so.5";
+						}
+					} else {
+						throw ex.GetBaseException ();
+					}
+				}
+			}
 		}
 
 		static void FindNCurses ()

+ 2 - 1
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -873,7 +873,7 @@ namespace Terminal.Gui {
 						keyUpHandler (new KeyEvent (map, keyModifiers));
 					}
 				}
-				if (!inputEvent.KeyEvent.bKeyDown && inputEvent.KeyEvent.dwControlKeyState == 0) {
+				if (!inputEvent.KeyEvent.bKeyDown) {
 					keyModifiers = null;
 				}
 				break;
@@ -908,6 +908,7 @@ namespace Terminal.Gui {
 				break;
 
 			case WindowsConsole.EventType.Focus:
+				keyModifiers = null;
 				break;
 			}
 		}

+ 59 - 45
Terminal.Gui/Core/Border.cs

@@ -168,7 +168,6 @@ namespace Terminal.Gui {
 				if (border == null) {
 					Border = new Border () {
 						BorderStyle = BorderStyle.Single,
-						BorderBrush = ColorScheme.Normal.Background,
 						Title = (ustring)title
 					};
 				} else {
@@ -318,8 +317,8 @@ namespace Terminal.Gui {
 		private BorderStyle borderStyle;
 		private bool drawMarginFrame;
 		private Thickness borderThickness;
-		private Color borderBrush;
-		private Color background;
+		private Color? borderBrush;
+		private Color? background;
 		private Thickness padding;
 		private bool effect3D;
 		private Point effect3DOffset = new Point (1, 1);
@@ -374,7 +373,7 @@ namespace Terminal.Gui {
 		/// Gets or sets the <see cref="Color"/> that draws the outer border color.
 		/// </summary>
 		public Color BorderBrush {
-			get => borderBrush;
+			get => borderBrush != null ? (Color)borderBrush : (Color)(-1);
 			set {
 				borderBrush = value;
 				OnBorderChanged ();
@@ -385,7 +384,7 @@ namespace Terminal.Gui {
 		/// Gets or sets the <see cref="Color"/> that fills the area between the bounds of a <see cref="Border"/>.
 		/// </summary>
 		public Color Background {
-			get => background;
+			get => background != null ? (Color)background : (Color)(-1);
 			set {
 				background = value;
 				OnBorderChanged ();
@@ -439,7 +438,6 @@ namespace Terminal.Gui {
 			set {
 				child = value;
 				if (child != null && Parent != null) {
-					Parent.Initialized += Parent_Initialized;
 					Parent.Removed += Parent_Removed;
 				}
 			}
@@ -452,30 +450,6 @@ namespace Terminal.Gui {
 			child.Removed -= Parent_Removed;
 		}
 
-		private void Parent_Initialized (object s, EventArgs e)
-		{
-			SetMarginFrameTitleBrush ();
-			child.Initialized -= Parent_Initialized;
-		}
-
-		private void SetMarginFrameTitleBrush ()
-		{
-			if (child != null) {
-				var view = Parent?.Border != null ? Parent : child;
-				if (view.ColorScheme != null) {
-					if (borderBrush == default) {
-						BorderBrush = view.GetNormalColor ().Foreground;
-					}
-					if (background == default) {
-						Background = view.GetNormalColor ().Background;
-					}
-					return;
-				}
-			}
-			BorderBrush = default;
-			Background = default;
-		}
-
 		/// <summary>
 		/// Gets the parent <see cref="Child"/> parent if any.
 		/// </summary>
@@ -609,7 +583,8 @@ namespace Terminal.Gui {
 			}
 
 			// Draw border thickness
-			driver.SetAttribute (new Attribute (BorderBrush));
+			SetBorderBrush (driver);
+
 			Child.Clear (borderRect);
 
 			borderRect = new Rect () {
@@ -624,7 +599,7 @@ namespace Terminal.Gui {
 				Child.Clear (borderRect);
 			}
 
-			driver.SetAttribute (new Attribute (BorderBrush, Background));
+			SetBorderBrushBackground (driver);
 
 			// Draw margin frame
 			if (DrawMarginFrame) {
@@ -661,7 +636,7 @@ namespace Terminal.Gui {
 
 			var savedAttribute = driver.GetAttribute ();
 
-			driver.SetAttribute (new Attribute (BorderBrush));
+			SetBorderBrush (driver);
 
 			// Draw the upper BorderThickness
 			for (int r = frame.Y - drawMarginFrame - sumThickness.Top;
@@ -703,7 +678,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (new Attribute (Background));
+			SetBackground (driver);
 
 			// Draw the upper Padding
 			for (int r = frame.Y - drawMarginFrame - padding.Top;
@@ -745,7 +720,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (new Attribute (BorderBrush, Background));
+			SetBorderBrushBackground (driver);
 
 			// Draw the MarginFrame
 			if (DrawMarginFrame) {
@@ -816,7 +791,7 @@ namespace Terminal.Gui {
 
 			var savedAttribute = driver.GetAttribute ();
 
-			driver.SetAttribute (new Attribute (BorderBrush));
+			SetBorderBrush (driver);
 
 			// Draw the upper BorderThickness
 			for (int r = frame.Y;
@@ -858,7 +833,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (new Attribute (Background));
+			SetBackground (driver);
 
 			// Draw the upper Padding
 			for (int r = frame.Y + borderThickness.Top;
@@ -900,7 +875,7 @@ namespace Terminal.Gui {
 				}
 			}
 
-			driver.SetAttribute (new Attribute (BorderBrush, Background));
+			SetBorderBrushBackground (driver);
 
 			// Draw the MarginFrame
 			if (DrawMarginFrame) {
@@ -962,6 +937,37 @@ namespace Terminal.Gui {
 			driver.SetAttribute (savedAttribute);
 		}
 
+		private void SetBorderBrushBackground (ConsoleDriver driver)
+		{
+			if (borderBrush != null && background != null) {
+				driver.SetAttribute (new Attribute (BorderBrush, Background));
+			} else if (borderBrush != null && background == null) {
+				driver.SetAttribute (new Attribute (BorderBrush, Parent.ColorScheme.Normal.Background));
+			} else if (borderBrush == null && background != null) {
+				driver.SetAttribute (new Attribute (Parent.ColorScheme.Normal.Foreground, Background));
+			} else {
+				driver.SetAttribute (Parent.ColorScheme.Normal);
+			}
+		}
+
+		private void SetBackground (ConsoleDriver driver)
+		{
+			if (background != null) {
+				driver.SetAttribute (new Attribute (Background));
+			} else {
+				driver.SetAttribute (new Attribute (Parent.ColorScheme.Normal.Background));
+			}
+		}
+
+		private void SetBorderBrush (ConsoleDriver driver)
+		{
+			if (borderBrush != null) {
+				driver.SetAttribute (new Attribute (BorderBrush));
+			} else {
+				driver.SetAttribute (new Attribute (Parent.ColorScheme.Normal.Foreground));
+			}
+		}
+
 		private Attribute GetEffect3DBrush ()
 		{
 			return Effect3DBrush == null
@@ -989,9 +995,8 @@ namespace Terminal.Gui {
 		{
 			var driver = Application.Driver;
 			if (DrawMarginFrame) {
-				driver.SetAttribute (new Attribute (BorderBrush, Background));
-				if (view.HasFocus)
-					driver.SetAttribute (new Attribute (Child.ColorScheme.HotNormal.Foreground, Background));
+				SetBorderBrushBackground (driver);
+				SetHotNormalBackground (view, driver);
 				var padding = view.Border.GetSumThickness ();
 				Rect scrRect;
 				if (view == Child) {
@@ -1007,6 +1012,17 @@ namespace Terminal.Gui {
 			driver.SetAttribute (Child.GetNormalColor ());
 		}
 
+		private void SetHotNormalBackground (View view, ConsoleDriver driver)
+		{
+			if (view.HasFocus) {
+				if (background != null) {
+					driver.SetAttribute (new Attribute (Child.ColorScheme.HotNormal.Foreground, Background));
+				} else {
+					driver.SetAttribute (Child.ColorScheme.HotNormal);
+				}
+			}
+		}
+
 		/// <summary>
 		/// Draws the <see cref="View.Text"/> to the screen.
 		/// </summary>
@@ -1016,10 +1032,8 @@ namespace Terminal.Gui {
 		{
 			var driver = Application.Driver;
 			if (DrawMarginFrame) {
-				driver.SetAttribute (new Attribute (BorderBrush, Background));
-				if (view.HasFocus) {
-					driver.SetAttribute (new Attribute (view.ColorScheme.HotNormal.Foreground, Background));
-				}
+				SetBorderBrushBackground (driver);
+				SetHotNormalBackground (view, driver);
 				var padding = Parent.Border.GetSumThickness ();
 				var scrRect = Parent.ViewToScreen (new Rect (0, 0, rect.Width, rect.Height));
 				driver.DrawWindowTitle (scrRect, view.Text,

+ 25 - 15
Terminal.Gui/Core/TextFormatter.cs

@@ -1176,24 +1176,35 @@ namespace Terminal.Gui {
 			}
 
 			var isVertical = IsVerticalDirection (textDirection);
-			var savedClip = Application.Driver?.Clip;
-			var maxBounds = bounds;
-			if (Application.Driver != null) {
-				Application.Driver.Clip = maxBounds = containerBounds == default
-					? bounds
-					: new Rect (Math.Max (containerBounds.X, bounds.X),
+			var maxBounds = containerBounds == default
+				? bounds
+				: new Rect (Math.Max (containerBounds.X, bounds.X),
 					Math.Max (containerBounds.Y, bounds.Y),
-					Math.Max (Math.Min (containerBounds.Width, containerBounds.Right - bounds.Left), 0),
-					Math.Max (Math.Min (containerBounds.Height, containerBounds.Bottom - bounds.Top), 0));
-			}
+					Math.Max (Math.Max (containerBounds.Width, containerBounds.Right - bounds.Left), 0),
+					Math.Max (Math.Max (containerBounds.Height, containerBounds.Bottom - bounds.Top), 0));
 
+			int boundsStart = 0;
+			if (isVertical) {
+				if (bounds.X < 0) {
+					boundsStart = bounds.X;
+				}
+			} else {
+				if (bounds.Y < 0) {
+					boundsStart = bounds.Y;
+				}
+			}
 			for (int line = 0; line < linesFormated.Count; line++) {
-				if ((isVertical && line > bounds.Width) || (!isVertical && line > bounds.Height))
+				if (boundsStart < 0) {
+					boundsStart++;
 					continue;
+				}
+				if ((isVertical && line > bounds.Width) || (!isVertical && line > bounds.Height)) {
+					continue;
+				}
 				if ((isVertical && line >= maxBounds.Left + maxBounds.Width)
-					|| (!isVertical && line >= maxBounds.Top + maxBounds.Height))
-
+					|| (!isVertical && line >= maxBounds.Top + maxBounds.Height)) {
 					break;
+				}
 
 				var runes = lines [line].ToRunes ();
 
@@ -1278,8 +1289,9 @@ namespace Terminal.Gui {
 					} else if (!fillRemaining && idx > runes.Length - 1) {
 						break;
 					}
-					if ((!isVertical && idx > maxBounds.Left + maxBounds.Width - bounds.X) || (isVertical && idx > maxBounds.Top + maxBounds.Height - bounds.Y))
+					if ((!isVertical && idx >= maxBounds.Left + maxBounds.Width - bounds.X) || (isVertical && idx >= maxBounds.Top + maxBounds.Height - bounds.Y)) {
 						break;
+					}
 
 					var rune = (Rune)' ';
 					if (isVertical) {
@@ -1316,8 +1328,6 @@ namespace Terminal.Gui {
 					}
 				}
 			}
-			if (Application.Driver != null)
-				Application.Driver.Clip = (Rect)savedClip;
 		}
 	}
 }

+ 5 - 20
Terminal.Gui/Core/View.cs

@@ -446,11 +446,10 @@ namespace Terminal.Gui {
 		public virtual Rect Frame {
 			get => frame;
 			set {
-				var rect = GetMaxNeedDisplay (frame, value);
-				frame = new Rect (value.X, value.Y, Math.Max (value.Width, 0), Math.Max (value.Height, 0));
+				frame = value;
 				TextFormatter.Size = GetBoundsTextFormatterSize ();
 				SetNeedsLayout ();
-				SetNeedsDisplay (rect);
+				SetNeedsDisplay ();
 			}
 		}
 
@@ -823,21 +822,7 @@ namespace Terminal.Gui {
 			}
 			TextFormatter.Size = GetBoundsTextFormatterSize ();
 			SetNeedsLayout ();
-			SetNeedsDisplay (GetMaxNeedDisplay (oldFrame, frame));
-		}
-
-		Rect GetMaxNeedDisplay (Rect oldFrame, Rect newFrame)
-		{
-			var rect = new Rect () {
-				X = Math.Min (oldFrame.X, newFrame.X),
-				Y = Math.Min (oldFrame.Y, newFrame.Y),
-				Width = Math.Max (oldFrame.Width, newFrame.Width),
-				Height = Math.Max (oldFrame.Height, newFrame.Height)
-			};
-			rect.Width += Math.Max (oldFrame.X - newFrame.X, 0);
-			rect.Height += Math.Max (oldFrame.Y - newFrame.Y, 0);
-
-			return rect;
+			SetNeedsDisplay ();
 		}
 
 		void TextFormatter_HotKeyChanged (Key obj)
@@ -1143,7 +1128,7 @@ namespace Terminal.Gui {
 		/// <param name="rcol">Absolute column; screen-relative.</param>
 		/// <param name="rrow">Absolute row; screen-relative.</param>
 		/// <param name="clipped">Whether to clip the result of the ViewToScreen method, if set to <see langword="true"/>, the rcol, rrow values are clamped to the screen (terminal) dimensions (0..TerminalDim-1).</param>
-		internal void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = true)
+		internal void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = false)
 		{
 			// Computes the real row, col relative to the screen.
 			rrow = row + frame.Y;
@@ -1283,7 +1268,7 @@ namespace Terminal.Gui {
 		/// <param name="row">Row.</param>
 		/// <param name="clipped">Whether to clip the result of the ViewToScreen method,
 		///  if set to <see langword="true"/>, the col, row values are clamped to the screen (terminal) dimensions (0..TerminalDim-1).</param>
-		public void Move (int col, int row, bool clipped = true)
+		public void Move (int col, int row, bool clipped = false)
 		{
 			if (Driver.Rows == 0) {
 				return;

+ 21 - 13
Terminal.Gui/Views/TabView.cs

@@ -22,11 +22,13 @@ namespace Terminal.Gui {
 		/// </summary>
 		TabRowView tabsBar;
 
+		private class TabContentView : View { }
+
 		/// <summary>
 		/// This sub view is the main client area of the current tab.  It hosts the <see cref="Tab.View"/> 
 		/// of the tab, the <see cref="SelectedTab"/>
 		/// </summary>
-		View contentView;
+		TabContentView contentView;
 		private List<Tab> tabs = new List<Tab> ();
 
 		/// <summary>
@@ -75,7 +77,13 @@ namespace Terminal.Gui {
 
 					if (selectedTab.View != null) {
 						// remove old content
-						contentView.Remove (selectedTab.View);
+						if (selectedTab.View.Subviews.Count == 0) {
+							contentView.Remove (selectedTab.View);
+						} else {
+							foreach (var view in selectedTab.View.Subviews) {
+								contentView.Remove (view);
+							}
+						}
 					}
 				}
 
@@ -85,7 +93,13 @@ namespace Terminal.Gui {
 
 					// add new content
 					if (selectedTab.View != null) {
-						contentView.Add (selectedTab.View);
+						if (selectedTab.View.Subviews.Count == 0) {
+							contentView.Add (selectedTab.View);
+						} else {
+							foreach (var view in selectedTab.View.Subviews) {
+								contentView.Add (view);
+							}
+						}
 					}
 				}
 
@@ -94,7 +108,6 @@ namespace Terminal.Gui {
 				if (old != value) {
 					OnSelectedTabChanged (old, value);
 				}
-
 			}
 		}
 
@@ -111,7 +124,7 @@ namespace Terminal.Gui {
 		public TabView () : base ()
 		{
 			CanFocus = true;
-			contentView = new View ();
+			contentView = new TabContentView ();
 			tabsBar = new TabRowView (this);
 
 			ApplyStyleChanges ();
@@ -195,7 +208,7 @@ namespace Terminal.Gui {
 				int startAtY = Math.Max (0, GetTabHeight (true) - 1);
 
 				DrawFrame (new Rect (0, startAtY, bounds.Width,
-			       Math.Max (bounds.Height - spaceAtBottom - startAtY, 0)), 0, true);
+					Math.Max (bounds.Height - spaceAtBottom - startAtY, 0)), 0, true);
 			}
 
 			if (Tabs.Any ()) {
@@ -215,14 +228,9 @@ namespace Terminal.Gui {
 		{
 			base.Dispose (disposing);
 
-			// The selected tab will automatically be disposed but
-			// any tabs not visible will need to be manually disposed
-
+			// Manually dispose all tabs
 			foreach (var tab in Tabs) {
-				if (!Equals (SelectedTab, tab)) {
-					tab.View?.Dispose ();
-				}
-
+				tab.View?.Dispose ();
 			}
 		}
 

+ 3 - 1
Terminal.Gui/Views/TextView.cs

@@ -2693,8 +2693,9 @@ namespace Terminal.Gui {
 			} else if (currentRow - topRow + BottomOffset >= Frame.Height + offB.height) {
 				topRow = Math.Min (Math.Max (currentRow - Frame.Height + 1 + BottomOffset, 0), currentRow);
 				need = true;
-			} else if (topRow > 0 && currentRow == topRow) {
+			} else if (topRow > 0 && currentRow < topRow) {
 				topRow = Math.Max (topRow - 1, 0);
+				need = true;
 			}
 			if (need) {
 				if (wrapNeeded) {
@@ -4107,6 +4108,7 @@ namespace Terminal.Gui {
 			leftColumn = 0;
 			TrackColumn ();
 			PositionCursor ();
+			SetNeedsDisplay ();
 		}
 
 		bool MoveNext (ref int col, ref int row, out Rune rune)

+ 1 - 1
Terminal.Gui/Windows/Dialog.cs

@@ -187,7 +187,7 @@ namespace Terminal.Gui {
 						if (i == 0) {
 							// first (leftmost) button - always hard flush left
 							var left = Bounds.Width - ((Border.DrawMarginFrame ? 2 : 0) + Border.BorderThickness.Left + Border.BorderThickness.Right);
-							button.X = Pos.AnchorEnd (left);
+							button.X = Pos.AnchorEnd (Math.Max (left, 0));
 						} else {
 							shiftLeft += button.Frame.Width + (spacing);
 							button.X = Pos.AnchorEnd (shiftLeft);

+ 9 - 2
Terminal.Gui/Windows/Wizard.cs

@@ -158,8 +158,14 @@ namespace Terminal.Gui {
 			/// </summary>
 			public event Action<TitleEventArgs> TitleChanged;
 
-			// The contentView works like the ContentView in FrameView.
-			private View contentView = new View () { Data = "WizardContentView" };
+			/// <summary>
+			/// WizardContentView is an internal implementation detail of Window. It is used to host Views added with <see cref="Add(View)"/>. 
+			/// Its ONLY reason for being is to provide a simple way for Window to expose to those SubViews that the Window's Bounds 
+			/// are actually deflated due to the border. 
+			/// </summary>
+			class WizardContentView : View { }
+
+			private WizardContentView contentView = new WizardContentView ();
 
 			/// <summary>
 			/// Sets or gets help text for the <see cref="WizardStep"/>.If <see cref="WizardStep.HelpText"/> is empty
@@ -383,6 +389,7 @@ namespace Terminal.Gui {
 				AddKeyBinding (Key.Esc, Command.QuitToplevel);
 			}
 
+			Initialized += (s, e) => Wizard_Loaded ();
 		}
 
 		private void Wizard_Loaded ()

+ 35 - 0
UICatalog/Dockerfile

@@ -0,0 +1,35 @@
+#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+FROM opensuse/tumbleweed AS base
+RUN zypper -n update
+RUN zypper --non-interactive install libicu
+RUN zypper --non-interactive install libncurses5
+RUN zypper --non-interactive install wget
+RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc
+RUN wget https://packages.microsoft.com/config/opensuse/15/prod.repo
+RUN mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo
+RUN chown root:root /etc/zypp/repos.d/microsoft-prod.repo
+RUN zypper --non-interactive install dotnet-sdk-7.0
+
+ENV LANG=en_US.UTF-8 \
+	TERM=xterm-256color \
+	DISPLAY=:0
+WORKDIR /app
+
+FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
+WORKDIR /src
+COPY ["Terminal.Gui/Directory.Build.props", "Terminal.Gui/"]
+COPY ["UICatalog/UICatalog.csproj", "UICatalog/"]
+COPY ["Terminal.Gui/Terminal.Gui.csproj", "Terminal.Gui/"]
+RUN dotnet restore "UICatalog/UICatalog.csproj"
+COPY . .
+WORKDIR "/src/UICatalog"
+RUN dotnet build "UICatalog.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "UICatalog.csproj" -c Release -o /app/publish /p:UseAppHost=false
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ENTRYPOINT ["dotnet", "UICatalog.dll"]

+ 3 - 0
UICatalog/Properties/launchSettings.json

@@ -50,6 +50,9 @@
     "Windows & FrameViews": {
       "commandName": "Project",
       "commandLineArgs": "\"Windows & FrameViews\""
+    },
+    "Docker": {
+      "commandName": "Docker"      
     }
   }
 }

+ 8 - 6
UICatalog/Scenarios/Editor.cs

@@ -57,12 +57,6 @@ namespace UICatalog.Scenarios {
 
 			CreateDemoFile (_fileName);
 
-			var siCursorPosition = new StatusItem (Key.Null, "", null);
-
-			_textView.UnwrappedCursorPosition += (e) => {
-				siCursorPosition.Title = $"Ln {e.Y + 1}, Col {e.X + 1}";
-			};
-
 			LoadFile ();
 
 			Win.Add (_textView);
@@ -116,6 +110,8 @@ namespace UICatalog.Scenarios {
 
 			Application.Top.Add (menu);
 
+			var siCursorPosition = new StatusItem (Key.Null, "", null);
+
 			var statusBar = new StatusBar (new StatusItem [] {
 				siCursorPosition,
 				new StatusItem(Key.F2, "~F2~ Open", () => Open()),
@@ -124,6 +120,12 @@ namespace UICatalog.Scenarios {
 				new StatusItem(Key.CtrlMask | Key.Q, "~^Q~ Quit", () => Quit()),
 				new StatusItem(Key.Null, $"OS Clipboard IsSupported : {Clipboard.IsSupported}", null)
 			});
+
+			_textView.UnwrappedCursorPosition += (e) => {
+				siCursorPosition.Title = $"Ln {e.Y + 1}, Col {e.X + 1}";
+				statusBar.SetNeedsDisplay ();
+			};
+
 			Application.Top.Add (statusBar);
 
 			_scrollBar = new ScrollBarView (_textView, true);

+ 9 - 0
UICatalog/Scenarios/TableEditor.cs

@@ -250,6 +250,11 @@ namespace UICatalog.Scenarios {
 
 		private void SetMinAcceptableWidthToOne ()
 		{
+			var columns = tableView?.Table?.Columns;
+			if (columns is null) {
+				MessageBox.ErrorQuery ("No Table", "No table is currently loaded", "Ok");
+				return;
+			}
 			foreach (DataColumn c in tableView.Table.Columns) 
 			{
 				var style = tableView.Style.GetOrCreateColumnStyle (c);
@@ -276,6 +281,10 @@ namespace UICatalog.Scenarios {
 
 		private void RunColumnWidthDialog (DataColumn col, string prompt, Action<ColumnStyle,int> setter,Func<ColumnStyle,int> getter)
 		{
+			if (col is null) {
+				MessageBox.ErrorQuery ("No Table", "No table is currently loaded", "Ok");
+				return;
+			}
 			var accepted = false;
 			var ok = new Button ("Ok", is_default: true);
 			ok.Clicked += () => { accepted = true; Application.RequestStop (); };

+ 2 - 0
UICatalog/UICatalog.csproj

@@ -11,6 +11,7 @@
     <FileVersion>1.10.1.0</FileVersion>
     <Version>1.10.1</Version>
     <InformationalVersion>1.10.1+6.Branch.main.Sha.f7ee66ddbf8dbcfb0d96af7d63789879091670ec</InformationalVersion>
+    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <DefineConstants>TRACE</DefineConstants>
@@ -22,6 +23,7 @@
     <None Update="./Scenarios/Spinning_globe_dark_small.gif" CopyToOutputDirectory="PreserveNewest" />
   </ItemGroup>
   <ItemGroup>
+    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
     <PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
     <PackageReference Include="CsvHelper" Version="30.0.1" />
     <PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />

+ 3 - 3
UnitTests/Core/BorderTests.cs

@@ -20,8 +20,8 @@ namespace Terminal.Gui.CoreTests {
 			Assert.Equal (BorderStyle.None, b.BorderStyle);
 			Assert.False (b.DrawMarginFrame);
 			Assert.Equal (default, b.BorderThickness);
-			Assert.Equal (default, b.BorderBrush);
-			Assert.Equal (default, b.Background);
+			Assert.Equal ((Color)(-1), b.BorderBrush);
+			Assert.Equal ((Color)(-1), b.Background);
 			Assert.Equal (default, b.Padding);
 			Assert.Equal (0, b.ActualWidth);
 			Assert.Equal (0, b.ActualHeight);
@@ -574,7 +574,7 @@ namespace Terminal.Gui.CoreTests {
 			var lblTop = new Label ("At 0,0");
 			var lblFrame = new Label ("Centered") { X = Pos.Center (), Y = Pos.Center () };
 			var frame = new FrameView () { Y = 1, Width = 20, Height = 3 };
-			var lblFill = new Label () { Width = Dim.Fill(),Height = Dim.Fill(), Visible = false };
+			var lblFill = new Label () { Width = Dim.Fill (), Height = Dim.Fill (), Visible = false };
 			var fillText = new System.Text.StringBuilder ();
 			for (int i = 0; i < frame.Bounds.Height; i++) {
 				if (i > 0) {

+ 3 - 4
UnitTests/UnitTests.csproj

@@ -21,15 +21,15 @@
     <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
-    <PackageReference Include="ReportGenerator" Version="5.1.20" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
+    <PackageReference Include="ReportGenerator" Version="5.1.21" />
     <PackageReference Include="System.Collections" Version="4.3.0" />
     <PackageReference Include="xunit" Version="2.4.2" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="coverlet.collector" Version="3.2.0">
+    <PackageReference Include="coverlet.collector" Version="6.0.0">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
@@ -56,6 +56,5 @@
     <IncludeTestAssembly>
       False
     </IncludeTestAssembly>
-    <RunSettingsFilePath>C:\Users\charlie\s\gui-cs\Terminal.Gui\UnitTests\bin\Debug\net7.0\fine-code-coverage\coverage-tool-output\UnitTests-fcc-mscodecoverage-generated.runsettings</RunSettingsFilePath>
   </PropertyGroup>
 </Project>

+ 70 - 69
UnitTests/Views/ViewTests.cs

@@ -1,6 +1,5 @@
 using NStack;
 using System;
-using System.Collections.Generic;
 using Terminal.Gui.Graphs;
 using Xunit;
 using Xunit.Abstractions;
@@ -3991,6 +3990,11 @@ This is a tes
 				CanFocus = true;
 			}
 
+			public DerivedView (Rect rect) : base (rect)
+			{
+				CanFocus = true;
+			}
+
 			public bool IsKeyDown { get; set; }
 			public bool IsKeyPress { get; set; }
 			public bool IsKeyUp { get; set; }
@@ -4014,22 +4018,9 @@ This is a tes
 				return true;
 			}
 
-			public void CorrectRedraw (Rect bounds)
+			public override void Redraw (Rect bounds)
 			{
-				// Clear the old and new frame area
-				Clear (NeedDisplay);
-				DrawText ();
-			}
-
-			public void IncorrectRedraw (Rect bounds)
-			{
-				// Clear only the new frame area
 				Clear ();
-				DrawText ();
-			}
-
-			private void DrawText ()
-			{
 				var idx = 0;
 				for (int r = 0; r < Frame.Height; r++) {
 					for (int c = 0; c < Frame.Width; c++) {
@@ -4218,38 +4209,35 @@ cccccccccccccccccccc", output);
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Frame ()
+		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Frame_On_LayoutStyle_Absolute ()
 		{
 			var label = new Label ("At 0,0");
-			var view = new DerivedView () {
-				X = 2,
-				Y = 2,
-				Width = 30,
-				Height = 2,
+			var view = new DerivedView (new Rect (2, 2, 30, 2)) {
 				Text = "A text with some long width\n and also with two lines."
 			};
 			var top = Application.Top;
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.CorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
 			view.Frame = new Rect (1, 1, 10, 1);
+			Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (1, 1, 31, 3), view.NeedDisplay);
-			view.CorrectRedraw (view.Bounds);
+			Assert.Equal (view.Bounds, view.NeedDisplay);
+			top.Redraw (top.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0     
  A text wit", output);
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Pos_Dim ()
+		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Pos_Dim_On_LayoutStyle_Computed ()
 		{
 			var label = new Label ("At 0,0");
 			var view = new DerivedView () {
@@ -4263,52 +4251,50 @@ At 0,0
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.CorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Computed, view.LayoutStyle);
 			view.X = 1;
 			view.Y = 1;
 			view.Width = 10;
 			view.Height = 1;
 			Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (1, 1, 31, 3), view.NeedDisplay);
-			view.CorrectRedraw (view.Bounds);
+			Assert.Equal (new Rect (0, 0, 30, 2), view.NeedDisplay);
+			top.Redraw (top.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0     
  A text wit", output);
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Frame ()
+		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_FrameOn_LayoutStyle_Absolute ()
 		{
 			var label = new Label ("At 0,0");
-			var view = new DerivedView () {
-				X = 2,
-				Y = 2,
-				Width = 30,
-				Height = 2,
+			var view = new DerivedView (new Rect (2, 2, 30, 2)) {
 				Text = "A text with some long width\n and also with two lines."
 			};
 			var top = Application.Top;
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.IncorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
 			view.Frame = new Rect (1, 1, 10, 1);
+			Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (1, 1, 31, 3), view.NeedDisplay);
-			view.IncorrectRedraw (view.Bounds);
+			Assert.Equal (view.Bounds, view.NeedDisplay);
+			// top needs redraw and calling view directly won't clear top.
+			view.Redraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
  A text wit                  
@@ -4317,7 +4303,7 @@ At 0,0
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Pos_Dim ()
+		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Up_Left_Using_Pos_DimOn_LayoutStyle_Computed ()
 		{
 			var label = new Label ("At 0,0");
 			var view = new DerivedView () {
@@ -4331,7 +4317,6 @@ At 0,0
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.IncorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
@@ -4344,8 +4329,9 @@ At 0,0
 			view.Height = 1;
 			Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (1, 1, 31, 3), view.NeedDisplay);
-			view.IncorrectRedraw (view.Bounds);
+			Assert.Equal (new Rect (0, 0, 30, 2), view.NeedDisplay);
+			// top needs redraw and calling view directly won't clear top.
+			view.Redraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
  A text wit                  
@@ -4354,31 +4340,29 @@ At 0,0
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Frame ()
+		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Frame_On_LayoutStyle_Absolute ()
 		{
 			var label = new Label ("At 0,0");
-			var view = new DerivedView () {
-				X = 2,
-				Y = 2,
-				Width = 30,
-				Height = 2,
+			var view = new DerivedView (new Rect (2, 2, 30, 2)) {
 				Text = "A text with some long width\n and also with two lines."
 			};
 			var top = Application.Top;
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.CorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			// it's LayoutStyle.Absolute so we can set the frame 
+			Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
 			view.Frame = new Rect (3, 3, 10, 1);
+			Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (2, 2, 30, 2), view.NeedDisplay);
-			view.CorrectRedraw (view.Bounds);
+			Assert.Equal (view.Bounds, view.NeedDisplay);
+			top.Redraw (top.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0       
              
@@ -4387,7 +4371,7 @@ At 0,0
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Pos_Dim ()
+		public void Correct_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Pos_Dim_On_LayoutStyle_Computed ()
 		{
 			var label = new Label ("At 0,0");
 			var view = new DerivedView () {
@@ -4401,21 +4385,21 @@ At 0,0
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.CorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Computed, view.LayoutStyle);
 			view.X = 3;
 			view.Y = 3;
 			view.Width = 10;
 			view.Height = 1;
 			Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (2, 2, 30, 2), view.NeedDisplay);
-			view.CorrectRedraw (view.Bounds);
+			Assert.Equal (new Rect (0, 0, 30, 2), view.NeedDisplay);
+			top.Redraw (top.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0       
              
@@ -4424,31 +4408,28 @@ At 0,0
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Frame ()
+		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Frame_On_LayoutStyle_Absolute ()
 		{
 			var label = new Label ("At 0,0");
-			var view = new DerivedView () {
-				X = 2,
-				Y = 2,
-				Width = 30,
-				Height = 2,
+			var view = new DerivedView (new Rect (2, 2, 30, 2)) {
 				Text = "A text with some long width\n and also with two lines."
 			};
 			var top = Application.Top;
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.IncorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
 			view.Frame = new Rect (3, 3, 10, 1);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (2, 2, 30, 2), view.NeedDisplay);
-			view.IncorrectRedraw (view.Bounds);
+			Assert.Equal (view.Bounds, view.NeedDisplay);
+			// top needs redraw and calling view directly won't clear top.
+			view.Redraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
@@ -4457,7 +4438,7 @@ At 0,0
 		}
 
 		[Fact, AutoInitShutdown]
-		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Pos_Dim ()
+		public void Incorrect_Redraw_Bounds_NeedDisplay_On_Shrink_And_Move_Down_Right_Using_Pos_Dim_On_LayoutStyle_Computed ()
 		{
 			var label = new Label ("At 0,0");
 			var view = new DerivedView () {
@@ -4471,21 +4452,22 @@ At 0,0
 			top.Add (label, view);
 			Application.Begin (top);
 
-			view.IncorrectRedraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
   A text with some long width
    and also with two lines.  ", output);
 
+			Assert.Equal (LayoutStyle.Computed, view.LayoutStyle);
 			view.X = 3;
 			view.Y = 3;
 			view.Width = 10;
 			view.Height = 1;
 			Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
 			Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-			Assert.Equal (new Rect (2, 2, 30, 2), view.NeedDisplay);
-			view.IncorrectRedraw (view.Bounds);
+			Assert.Equal (new Rect (0, 0, 30, 2), view.NeedDisplay);
+			// top needs redraw and calling view directly won't clear top.
+			view.Redraw (view.Bounds);
 			TestHelpers.AssertDriverContentsWithFrameAre (@"
 At 0,0                       
                              
@@ -4493,7 +4475,6 @@ At 0,0
    A text witith two lines.  ", output);
 		}
 
-
 		[Fact, AutoInitShutdown]
 		public void Test_Nested_Views_With_Height_Equal_To_One ()
 		{
@@ -4511,7 +4492,6 @@ At 0,0
 			v.LayoutSubviews ();
 			v.Redraw (v.Bounds);
 
-
 			string looksLike =
 @"    
 111
@@ -4519,5 +4499,26 @@ At 0,0
 222";
 			TestHelpers.AssertDriverContentsAre (looksLike, output);
 		}
+
+		[Fact, AutoInitShutdown]
+		public void Move_And_ViewToScreen_Should_Not_Use_Clipped_Parameter_As_True_By_Default_But_Only_For_Cursor ()
+		{
+			var container = new View () { Width = 10, Height = 2 };
+			var top = new View () { Width = 10, Height = 1 };
+			var label = new Label ("Label");
+			top.Add (label);
+			var bottom = new View () { Y = 1, Width = 10, Height = 1 };
+			container.Add (top, bottom);
+			Application.Top.Add (container);
+			Application.Begin (Application.Top);
+
+			TestHelpers.AssertDriverContentsAre (@"
+Label", output);
+
+			((FakeDriver)Application.Driver).SetBufferSize (10, 1);
+			Application.Refresh ();
+			TestHelpers.AssertDriverContentsAre (@"
+Label", output);
+		}
 	}
 }