@@ -42,6 +42,7 @@ type runOptions struct {
42
42
Detach bool
43
43
Remove bool
44
44
noTty bool
45
+ interactive bool
45
46
user string
46
47
workdir string
47
48
entrypoint string
@@ -158,9 +159,8 @@ func runCommand(p *projectOptions, backend api.Service) *cobra.Command {
158
159
flags .BoolVar (& opts .servicePorts , "service-ports" , false , "Run command with the service's ports enabled and mapped to the host." )
159
160
flags .BoolVar (& opts .quietPull , "quiet-pull" , false , "Pull without printing progress information." )
160
161
161
- cmd .Flags ().BoolP ("interactive" , "i" , true , "Keep STDIN open even if not attached. DEPRECATED" )
162
- cmd .Flags ().MarkHidden ("interactive" ) //nolint:errcheck
163
- cmd .Flags ().BoolP ("tty" , "t" , true , "Allocate a pseudo-TTY. DEPRECATED" )
162
+ cmd .Flags ().BoolVarP (& opts .interactive , "interactive" , "i" , true , "Keep STDIN open even if not attached." )
163
+ cmd .Flags ().BoolP ("tty" , "t" , true , "Allocate a pseudo-TTY." )
164
164
cmd .Flags ().MarkHidden ("tty" ) //nolint:errcheck
165
165
166
166
flags .SetNormalizeFunc (normalizeRunFlags )
@@ -221,6 +221,14 @@ func runRun(ctx context.Context, backend api.Service, project *types.Project, op
221
221
Index : 0 ,
222
222
QuietPull : opts .quietPull ,
223
223
}
224
+
225
+ for i , service := range project .Services {
226
+ if service .Name == opts .Service {
227
+ service .StdinOpen = opts .interactive
228
+ project .Services [i ] = service
229
+ }
230
+ }
231
+
224
232
exitCode , err := backend .RunOneOffContainer (ctx , project , runOpts )
225
233
if exitCode != 0 {
226
234
errMsg := ""
0 commit comments