Skip to content

Commit 3526d60

Browse files
committed
Removed direct access to stdio streams in debug command
1 parent 2be2228 commit 3526d60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/debug/debug.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ func runDebugCommand(command *cobra.Command, args []string) {
102102
ctrlc := make(chan os.Signal, 1)
103103
signal.Notify(ctrlc, os.Interrupt)
104104

105-
if _, err := debug.Debug(context.Background(), debugConfigRequested, os.Stdin, os.Stdout, ctrlc); err != nil {
105+
in, out, err := feedback.InteractiveStreams()
106+
if err != nil {
107+
feedback.FatalError(err, errorcodes.ErrBadArgument)
108+
}
109+
if _, err := debug.Debug(context.Background(), debugConfigRequested, in, out, ctrlc); err != nil {
106110
feedback.Fatal(tr("Error during Debug: %v", err), errorcodes.ErrGeneric)
107111
}
108112

0 commit comments

Comments
 (0)