Test GoTerminal
-
Get the test code
git clone https://github.com/zhan9san/GoTerminal.git
-
Build a binary, IsTerminal
cd GoTerminal/IsTerminal go build
-
Verify the difference
-
Run in terminal
$ ./IsTerminal IsTerminal: true
-
Run IsTerminal thru Golang os/exec
$ cd ../ExecIsTerminal $ go run main.go Starting command out: IsTerminal: false err:
-