| skipped 94 lines |
95 | 95 | | // Blocks until the context expires. |
96 | 96 | | func Run(ctx context.Context, t terminalapi.Terminal, c *container.Container, opts ...Option) error { |
97 | 97 | | td := newTermdash(t, c, opts...) |
98 | | - | defer td.stop() |
99 | 98 | | |
100 | | - | return td.start(ctx) |
| 99 | + | err := td.start(ctx) |
| 100 | + | // Only return the status (error or nil) after the termdash event |
| 101 | + | // processing goroutine actually exits. |
| 102 | + | td.stop() |
| 103 | + | return err |
101 | 104 | | } |
102 | 105 | | |
103 | 106 | | // Controller controls a termdash instance. |
| skipped 238 lines |