Skip to content

Commit a35a055

Browse files
committed
fix(examples): keep the embedded prompt visible in textual_tty_embed
1 parent 0a2241a commit a35a055

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎examples/textual_tty_embed.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,14 @@ class Cmd2InTextual(App[None]):
163163
TITLE = "cmd2 inside Textual"
164164

165165
CSS = """
166-
#cmd2 {
166+
#cmd2-pane {
167167
width: 2fr;
168168
border: round $primary;
169169
}
170+
#cmd2 {
171+
width: 1fr;
172+
height: 1fr;
173+
}
170174
#sidebar {
171175
width: 1fr;
172176
}
@@ -184,7 +188,10 @@ def compose(self) -> ComposeResult:
184188
"""Create the layout: the terminal running cmd2 on the left and the status panels on the right."""
185189
yield Header()
186190
with Horizontal():
187-
yield Terminal(command=[sys.executable, __file__, "--cmd2-only"], id="cmd2")
191+
# The border is on a container because a Terminal sizes its pseudo-terminal from its outer size, so a
192+
# border on the Terminal itself makes the cmd2 app draw more rows than are visible and hides its prompt
193+
with Vertical(id="cmd2-pane"):
194+
yield Terminal(command=[sys.executable, __file__, "--cmd2-only"], id="cmd2")
188195
with Vertical(id="sidebar"):
189196
yield StatusPanel(id="status")
190197
yield ClockPanel(id="clock")

0 commit comments

Comments
 (0)