Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttycolor.go on windows #211

Open
mtvee opened this issue Apr 29, 2017 · 0 comments
Open

ttycolor.go on windows #211

mtvee opened this issue Apr 29, 2017 · 0 comments

Comments

@mtvee
Copy link

mtvee commented Apr 29, 2017

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 ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant