Beispiel #1
0
func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
	var shouldEmulateANSI bool
	switch {
	case os.Getenv("ConEmuANSI") == "ON":
		// ConEmu shell, ansi emulated by default and ConEmu does an extensively
		// good emulation.
		shouldEmulateANSI = false
	case os.Getenv("MSYSTEM") != "":
		// MSYS (mingw) cannot fully emulate well and still shows escape characters
		// mostly because it's still running on cmd.exe window.
		shouldEmulateANSI = true
	default:
		shouldEmulateANSI = true
	}

	if shouldEmulateANSI {
		return winconsole.StdStreams()
	}

	return os.Stdin, os.Stdout, os.Stderr
}
Beispiel #2
0
func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
	return winconsole.StdStreams()
}