goterminal

package module
v0.0.0-...-e705f5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 1 Imported by: 0

README

goTerminal

像Cygwin的命令行go工具库 go Cygwin like terminal go terminal for golang

用法

package main

import (
	"fmt"
	"gitee.com/shirdonl/goTerminal"
	"os"
)

func main() {
	if goterminal.IsTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Terminal")
	} else if goterminal.IsCygwinTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Cygwin/MSYS2 Terminal")
	} else {
		fmt.Println("Is Not Terminal")
	}
}

安装

$ go get gitee.com/shirdonl/goTerminal

License

MIT

Documentation

Overview

Package goterminal implements interface to goterminal

Example
if goterminal.IsTerminal(os.Stdout.Fd()) {
	fmt.Println("Is Terminal")
} else if goterminal.IsCygwinTerminal(os.Stdout.Fd()) {
	fmt.Println("Is Cygwin/MSYS2 Terminal")
} else {
	fmt.Println("Is Not Terminal")
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCygwinTerminal

func IsCygwinTerminal(fd uintptr) bool

IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 terminal. This is also always false on this environment.

func IsTerminal

func IsTerminal(fd uintptr) bool

IsTerminal return true if the file descriptor is terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL