mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
remove wrapped streams and readline
This commit is contained in:
@@ -3,11 +3,11 @@ package command
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/terraform/internal/addrs"
|
||||
"github.com/hashicorp/terraform/internal/backend"
|
||||
"github.com/hashicorp/terraform/internal/helper/wrappedstreams"
|
||||
"github.com/hashicorp/terraform/internal/repl"
|
||||
"github.com/hashicorp/terraform/internal/terraform"
|
||||
"github.com/hashicorp/terraform/internal/tfdiags"
|
||||
@@ -113,8 +113,8 @@ func (c *ConsoleCommand) Run(args []string) int {
|
||||
|
||||
// Set up the UI so we can output directly to stdout
|
||||
ui := &cli.BasicUi{
|
||||
Writer: wrappedstreams.Stdout(),
|
||||
ErrorWriter: wrappedstreams.Stderr(),
|
||||
Writer: os.Stdout,
|
||||
ErrorWriter: os.Stderr,
|
||||
}
|
||||
|
||||
evalOpts := &terraform.EvalOpts{}
|
||||
@@ -164,7 +164,7 @@ func (c *ConsoleCommand) Run(args []string) int {
|
||||
|
||||
func (c *ConsoleCommand) modePiped(session *repl.Session, ui cli.Ui) int {
|
||||
var lastResult string
|
||||
scanner := bufio.NewScanner(wrappedstreams.Stdin())
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
for scanner.Scan() {
|
||||
result, exit, diags := session.Handle(strings.TrimSpace(scanner.Text()))
|
||||
if diags.HasErrors() {
|
||||
|
||||
@@ -9,6 +9,7 @@ package command
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/hashicorp/terraform/internal/repl"
|
||||
|
||||
@@ -23,6 +24,9 @@ func (c *ConsoleCommand) modeInteractive(session *repl.Session, ui cli.Ui) int {
|
||||
InterruptPrompt: "^C",
|
||||
EOFPrompt: "exit",
|
||||
HistorySearchFold: true,
|
||||
Stdin: os.Stdin,
|
||||
Stdout: os.Stdout,
|
||||
Stderr: os.Stderr,
|
||||
})
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf(
|
||||
|
||||
Reference in New Issue
Block a user