mirror of
https://github.com/johnkerl/miller.git
synced 2026-08-04 13:33:18 +00:00
Fix stdin-is-a-terminal check for Windows
This commit is contained in:
parent
fe204e9fa3
commit
493ae2aa30
1 changed files with 3 additions and 5 deletions
|
|
@ -20,12 +20,10 @@ const DEFAULT_PRIMARY_PROMPT = "[mlr] "
|
|||
const DEFAULT_SECONDARY_PROMPT = ""
|
||||
|
||||
func getInputIsTerminal() bool {
|
||||
if runtime.GOOS == "windows" {
|
||||
if runtime.GOOS == "windows" && os.Getenv("MSYSTEM") != "" {
|
||||
// Sadly, term.IsTerminal doesn't work inside MSYS2 but does work
|
||||
// outside MSYS2. Also sadly, I don't know how to tell the difference
|
||||
// programatically between inside/outside MSYS2 here. So, as a
|
||||
// workaround, I am simply defaulting to "is a terminal" here. Issues
|
||||
// with regression-testing will need to be dealt with later.
|
||||
// outside MSYS2. So in that case we simply return true so that the mlr
|
||||
// repl has a prompt.
|
||||
return true
|
||||
} else {
|
||||
return term.IsTerminal(int(os.Stdin.Fd()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue