Skip to content

Commit 32337a2

Browse files
fix: RunWithOutput stdout conflict and clipboard security warning
1 parent b37c2c3 commit 32337a2

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

cmd/modern/root/open/clipboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ func copyPasswordToClipboard(user *sqlconfig.User, out *output.Output) bool {
3232
return false
3333
}
3434

35-
out.Info(localizer.Sprintf("Password copied to clipboard - paste it when prompted"))
35+
out.Info(localizer.Sprintf("Password copied to clipboard - paste it when prompted, then clear your clipboard"))
3636
return true
3737
}

internal/tools/tool/tool.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package tool
55

66
import (
7+
"bytes"
78
"fmt"
89
"strings"
910

@@ -75,12 +76,12 @@ func (t *tool) RunWithOutput(args []string) (string, int, error) {
7576
}
7677

7778
cmd := t.generateCommandLine(args)
78-
output, err := cmd.Output()
79+
err := cmd.Run()
7980

8081
exitCode := 0
8182
if cmd.ProcessState != nil {
8283
exitCode = cmd.ProcessState.ExitCode()
8384
}
8485

85-
return string(output), exitCode, err
86+
return cmd.Stdout.(*bytes.Buffer).String(), exitCode, err
8687
}

0 commit comments

Comments
 (0)