Skip to content

ttycolor.go on windows #211

@mtvee

Description

@mtvee
diff --git a/ttycolors.go b/ttycolors.go
index fe63c1a..a5228b5 100644
--- a/ttycolors.go
+++ b/ttycolors.go
@@ -2,7 +2,7 @@ package web

 import (
        "golang.org/x/crypto/ssh/terminal"
-       "syscall"
+       "os"
 )

 var ttyCodes struct {
@@ -22,7 +22,7 @@ func ttyBold(code string) string {
 }

 func ttyEscape(code string) string {
-       if terminal.IsTerminal(syscall.Stdout) {
+       if terminal.IsTerminal(int(os.Stdout.Fd())) {
                return "\x1b[" + code + "m"
        } else {
                return ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions