@@ -1222,8 +1222,27 @@ func (a *App) renderMonitorGrid() string {
12221222 return ""
12231223 }
12241224
1225- layoutKey := a .monitorLayoutKeyFor (tabs , gridW , gridH , nil )
1225+ tabSizes := make ([]center.TabSize , 0 , len (tabs ))
1226+ for i , tab := range tabs {
1227+ rect := monitorTileRect (grid , i , gridX , gridY )
1228+ contentW := rect .W - 2
1229+ contentH := rect .H - 3 // border + header line
1230+ if contentW < 1 {
1231+ contentW = 1
1232+ }
1233+ if contentH < 1 {
1234+ contentH = 1
1235+ }
1236+ tabSizes = append (tabSizes , center.TabSize {
1237+ ID : tab .ID ,
1238+ Width : contentW ,
1239+ Height : contentH ,
1240+ })
1241+ }
1242+
1243+ layoutKey := a .monitorLayoutKeyFor (tabs , gridW , gridH , tabSizes )
12261244 if layoutKey != a .monitorLayoutKey {
1245+ a .center .ResizeTabs (tabSizes )
12271246 a .monitorLayoutKey = layoutKey
12281247 }
12291248
@@ -2171,7 +2190,9 @@ func (a *App) sendPrefixToTerminal() {
21712190func (a * App ) updateLayout () {
21722191 a .dashboard .SetSize (a .layout .DashboardWidth (), a .layout .Height ())
21732192
2174- a .center .SetSize (a .layout .CenterWidth (), a .layout .Height ())
2193+ if ! a .monitorMode {
2194+ a .center .SetSize (a .layout .CenterWidth (), a .layout .Height ())
2195+ }
21752196 a .center .SetOffset (a .layout .DashboardWidth ()) // Set X offset for mouse coordinate conversion
21762197 a .center .SetCanFocusRight (a .layout .ShowSidebar ())
21772198 a .dashboard .SetCanFocusRight (a .layout .ShowCenter ())
0 commit comments