@@ -90,7 +90,22 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
90
90
first = false
91
91
}
92
92
93
- kEvents := s .startMenu (ctx , project , options , signalChan )
93
+ var kEvents <- chan keyboard.KeyEvent
94
+ if options .Start .NavigationMenu {
95
+ kEvents , err = keyboard .GetKeys (100 )
96
+ if err != nil {
97
+ logrus .Warn ("Could not start Menu - an error occurred while starting." )
98
+ } else {
99
+ isWatchConfigured := s .shouldWatch (project )
100
+ isDockerDesktopActive := s .isDesktopIntegrationActive ()
101
+ tracing .KeyboardMetrics (ctx , options .Start .NavigationMenu , isDockerDesktopActive , isWatchConfigured )
102
+
103
+ formatter .NewKeyboardManager (ctx , isDockerDesktopActive , isWatchConfigured , signalChan , s .Watch )
104
+ if options .Start .Watch {
105
+ formatter .KeyboardManager .StartWatch (ctx , project , options )
106
+ }
107
+ }
108
+ }
94
109
for {
95
110
select {
96
111
case <- doneCh :
@@ -165,30 +180,3 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
165
180
}
166
181
return err
167
182
}
168
-
169
- func (s * composeService ) startMenu (
170
- ctx context.Context ,
171
- project * types.Project ,
172
- options api.UpOptions ,
173
- sc chan <- os.Signal ,
174
- ) <- chan keyboard.KeyEvent {
175
- if ! options .Start .NavigationMenu {
176
- return nil
177
- }
178
- kEvents , err := keyboard .GetKeys (100 )
179
- keyboardInitiated := err == nil
180
- if ! keyboardInitiated {
181
- logrus .Warn ("Could not start Menu - an error occurred while starting." )
182
- return nil
183
- }
184
-
185
- isWatchConfigured := s .shouldWatch (project )
186
- isDockerDesktopActive := s .isDesktopIntegrationActive ()
187
- tracing .KeyboardMetrics (ctx , options .Start .NavigationMenu , isDockerDesktopActive , isWatchConfigured )
188
-
189
- formatter .NewKeyboardManager (ctx , isDockerDesktopActive , isWatchConfigured , sc , s .Watch )
190
- if options .Start .Watch {
191
- formatter .KeyboardManager .StartWatch (ctx , project , options )
192
- }
193
- return kEvents
194
- }
0 commit comments