@@ -64,10 +64,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6464
6565 switch msg := msg .(type ) {
6666 case tea.WindowSizeMsg :
67- m .width = min (msg .Width - 4 , app .MAX_CONTAINER_WIDTH )
68- if m .app .Config .Layout == opencode .LayoutConfigStretch {
69- m .width = msg .Width - 4
70- }
67+ m .width = msg .Width - 4
7168 return m , nil
7269 case spinner.TickMsg :
7370 m .spinner , cmd = m .spinner .Update (msg )
@@ -180,6 +177,11 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
180177}
181178
182179func (m * editorComponent ) Content () string {
180+ width := m .width
181+ if m .app .Session .ID == "" {
182+ width = min (width , 80 )
183+ }
184+
183185 t := theme .CurrentTheme ()
184186 base := styles .NewStyle ().Foreground (t .Text ()).Background (t .Background ()).Render
185187 muted := styles .NewStyle ().Foreground (t .TextMuted ()).Background (t .Background ()).Render
@@ -188,7 +190,7 @@ func (m *editorComponent) Content() string {
188190 Bold (true )
189191 prompt := promptStyle .Render (">" )
190192
191- m .textarea .SetWidth (m . width - 6 )
193+ m .textarea .SetWidth (width - 6 )
192194 textarea := lipgloss .JoinHorizontal (
193195 lipgloss .Top ,
194196 prompt ,
@@ -200,7 +202,7 @@ func (m *editorComponent) Content() string {
200202 }
201203 textarea = styles .NewStyle ().
202204 Background (t .BackgroundElement ()).
203- Width (m . width ).
205+ Width (width ).
204206 PaddingTop (1 ).
205207 PaddingBottom (1 ).
206208 BorderStyle (lipgloss .ThickBorder ()).
@@ -236,7 +238,7 @@ func (m *editorComponent) Content() string {
236238 model = muted (m .app .Provider .Name ) + base (" " + m .app .Model .Name )
237239 }
238240
239- space := m . width - 2 - lipgloss .Width (model ) - lipgloss .Width (hint )
241+ space := width - 2 - lipgloss .Width (model ) - lipgloss .Width (hint )
240242 spacer := styles .NewStyle ().Background (t .Background ()).Width (space ).Render ("" )
241243
242244 info := hint + spacer + model
@@ -247,9 +249,14 @@ func (m *editorComponent) Content() string {
247249}
248250
249251func (m * editorComponent ) View () string {
252+ width := m .width
253+ if m .app .Session .ID == "" {
254+ width = min (width , 80 )
255+ }
256+
250257 if m .Lines () > 1 {
251258 return lipgloss .Place (
252- m . width ,
259+ width ,
253260 5 ,
254261 lipgloss .Center ,
255262 lipgloss .Center ,
0 commit comments