Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for IsTerminal (0.22 sec)

  1. internal/color/color.go

    	// ansi coloring on dumb terminals.
    	IsTerminal = func() bool {
    		return !color.NoColor
    	}
    
    	Bold = func() func(format string, a ...interface{}) string {
    		if IsTerminal() {
    			return color.New(color.Bold).SprintfFunc()
    		}
    		return fmt.Sprintf
    	}()
    
    	RedBold = func() func(a ...interface{}) string {
    		if IsTerminal() {
    			return color.New(color.FgRed, color.Bold).SprintFunc()
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Dec 13 16:27:40 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  2. internal/logger/utils.go

    	if runtime.GOOS == "windows" {
    		return
    	}
    	if color.IsTerminal() {
    		ansiEscape("[%dC", n)
    	}
    }
    
    func ansiSaveAttributes() {
    	if runtime.GOOS == "windows" {
    		return
    	}
    	if color.IsTerminal() {
    		ansiEscape("7")
    	}
    }
    
    func ansiRestoreAttributes() {
    	if runtime.GOOS == "windows" {
    		return
    	}
    	if color.IsTerminal() {
    		ansiEscape("8")
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Aug 04 23:10:08 GMT 2022
    - 1.7K bytes
    - Viewed (0)
  3. cmd/server-startup-msg.go

    	apiEndpointStr := strings.TrimSpace(strings.Join(apiEndpoints, "  "))
    	// Colorize the message and print.
    	logger.Info(color.Blue("API: ") + color.Bold(fmt.Sprintf("%s ", apiEndpointStr)))
    	if color.IsTerminal() && (!globalServerCtxt.Anonymous && !globalServerCtxt.JSON && globalAPIConfig.permitRootAccess()) {
    		logger.Info(color.Blue("   RootUser: ") + color.Bold("%s ", cred.AccessKey))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  4. istioctl/pkg/util/formatting/formatter.go

    	return "\033[0m"
    }
    
    func IstioctlColorDefault(writer io.Writer) bool {
    	if strings.EqualFold(termEnvVar.Get(), "dumb") {
    		return false
    	}
    
    	file, ok := writer.(*os.File)
    	if ok {
    		if !isatty.IsTerminal(file.Fd()) {
    			return false
    		}
    	}
    
    	return true
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Jul 11 02:41:45 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. istioctl/pkg/analyze/analyze.go

    	var readers []local.ReaderSource
    	for _, f := range args {
    		var r *os.File
    
    		// Handle "-" as stdin as a special case.
    		if f == "-" {
    			if isatty.IsTerminal(os.Stdin.Fd()) && !isJSONorYAMLOutputFormat() {
    				fmt.Fprint(cmd.OutOrStdout(), "Reading from stdin:\n")
    			}
    			r = os.Stdin
    			readers = append(readers, local.ReaderSource{Name: f, Reader: r})
    			continue
    		}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 17K bytes
    - Viewed (0)
Back to top