File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,14 @@ func NewProgram[T any](model Model[T], opts ...ProgramOption[T]) *Program[T] {
307
307
opt (p )
308
308
}
309
309
310
+ return p
311
+ }
312
+
313
+ func (p * Program [T ]) init () {
314
+ p .msgs = make (chan Msg )
315
+ p .rendererDone = make (chan struct {})
316
+ p .modes = ansi.Modes {}
317
+
310
318
// A context can be provided with a ProgramOption, but if none was provided
311
319
// we'll use the default background context.
312
320
if p .ctx == nil {
@@ -348,8 +356,6 @@ func NewProgram[T any](model Model[T], opts ...ProgramOption[T]) *Program[T] {
348
356
}
349
357
}
350
358
}
351
-
352
- return p
353
359
}
354
360
355
361
func (p * Program [T ]) handleSignals () chan struct {} {
@@ -732,6 +738,8 @@ func (p *Program[T]) Run() error {
732
738
}
733
739
734
740
func (p * Program [T ]) Start () error {
741
+ p .init ()
742
+
735
743
p .handlers = channelHandlers {}
736
744
cmds := make (chan Cmd )
737
745
p .errs = make (chan error )
You can’t perform that action at this time.
0 commit comments