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

cmd/go: cannot use 'go test' with code depending on TERM variable #12096

Closed
ericwq opened this issue Aug 10, 2015 · 2 comments
Closed

cmd/go: cannot use 'go test' with code depending on TERM variable #12096

ericwq opened this issue Aug 10, 2015 · 2 comments
Milestone

Comments

@ericwq
Copy link

ericwq commented Aug 10, 2015

if you run the following simple test code under 1.5rc1

func TestTermEnv(t *testing.T) {
    fmt.Printf("%s\n",os.Getenv("TERM"))
}

you will get the wrong TERM variable, while the correct result should be "xterm" prefixed.

$go test
dumb

the environment:

$ uname -a
Darwin wangs-MacBook.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
$ go version
go version go1.5rc1 darwin/amd64
$ env | grep TERM
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
TERM_PROGRAM_VERSION=343.7
TERM_SESSION_ID=0033F701-265E-4DF7-B4DA-2FD9C735BD4A

i notice there is a default "dumb" value for TERM env. is this the correct default value?
the previous issue #11449 only solve the "go run" case.

@rsc
Copy link
Contributor

rsc commented Aug 10, 2015

This is the second environment bug we've had because the compilation environment leaked into execution. We probably need separate environments.

@gopherbot
Copy link

CL https://golang.org/cl/13449 mentions this issue.

@rsc rsc closed this as completed in 58035ec Aug 11, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Aug 13, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants