You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When rendering a Panel, if the content is too wide for the terminal, it will wrap to the next line within the panel. This behavior is tested in PanelTests.Should_Use_Max_Width_If_Specified_Width_Is_Too_Large.
However, when a Panel is placed within a Layout, the layout restricts the panel's height to the console's height. Consequently, the Segment.SplitLines method truncates any lines that exceed this height. This results in inconsistency because if a standalone panel exceeds the console height, it prints entirely, requiring you to scroll up. But within a layout, only the initial portion is printed, and the rest is truncated from the output.
To Reproduce
Run this test:
// Givenvarconsole=new TestConsole().Size(new Size(20,2+2));// only space for 2 lines plus 2 because of the bordervarpanel=new Panel(new Text("Lorem ipsum dolor sit amet, consectetur odio."));// the text has 4 linesvarlayout=new Layout().Update(panel);// When
console.Write(layout);// Thenreturn Verifier.Verify(console.Output);
This will print the following to the console:
┌──────────────────┐
│ Lorem ipsum │
│ dolor sit amet, │
│ consectetur │
Expected behavior
The console contains:
┌──────────────────┐
│ Lorem ipsum │
│ dolor sit amet, │
│ consectetur │
│ odio. │
└──────────────────┘
where the only lower bit is visible because the content exceeds the height of the console.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
I apologise if this is the expected behaviour. In my use case, I have a layout with two columns showing a bunch of text and I don't really care if it exceeds the height of the console. This is an interactive tool and I expect the user to scroll up if they miss something. The layout as far as I know always adjusts to the height of the console and I could set the height explicitly based on the number of lines I want to show in each panel but I don't know in advance if there are any lines which wrap around and thus increase the height requirement. Can you give me any hints on how to implement this or are you open for contributions addressing this particular issue?
Information
Describe the bug
When rendering a
Panel
, if the content is too wide for the terminal, it will wrap to the next line within the panel. This behavior is tested inPanelTests.Should_Use_Max_Width_If_Specified_Width_Is_Too_Large.
However, when a
Panel
is placed within aLayout
, the layout restricts the panel's height to the console's height. Consequently, theSegment.SplitLines
method truncates any lines that exceed this height. This results in inconsistency because if a standalone panel exceeds the console height, it prints entirely, requiring you to scroll up. But within a layout, only the initial portion is printed, and the rest is truncated from the output.To Reproduce
Run this test:
This will print the following to the console:
Expected behavior
The console contains:
where the only lower bit is visible because the content exceeds the height of the console.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: