mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-21 08:20:23 +00:00
Don't store cmd stdout in string
Storing the stdout confuses isatty causing programs running within ShellMode to not format properly. Fixes #862
This commit is contained in:
parent
b7c99c52d2
commit
17dac164ea
1 changed files with 2 additions and 4 deletions
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
|
|
@ -661,10 +660,10 @@ func HandleShellCommand(input string, openTerm bool, waitToFinish bool) string {
|
|||
args := SplitCommandArgs(input)[1:]
|
||||
|
||||
// Set up everything for the command
|
||||
var outputBuf bytes.Buffer
|
||||
var output string
|
||||
cmd := exec.Command(inputCmd, args...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = io.MultiWriter(os.Stdout, &outputBuf)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
// This is a trap for Ctrl-C so that it doesn't kill micro
|
||||
|
|
@ -680,7 +679,6 @@ func HandleShellCommand(input string, openTerm bool, waitToFinish bool) string {
|
|||
cmd.Start()
|
||||
err := cmd.Wait()
|
||||
|
||||
output := outputBuf.String()
|
||||
if err != nil {
|
||||
output = err.Error()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue