termcolor

package
v2026.701.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RedBlockBorder = "==="
View Source
const SystemBorder = "===SYSTEM==="

Variables

This section is empty.

Functions

func BackgroundRGB

func BackgroundRGB(r, g, b uint8) string

func ChatSeparatorVisibleWidth added in v2026.621.0

func ChatSeparatorVisibleWidth(termW int) int

func ChatSeparatorWidth added in v2026.621.0

func ChatSeparatorWidth(termW int) int

func ColorizeAtTagsReplInput added in v2026.606.3

func ColorizeAtTagsReplInput(s string) string

func ColorizeErrorLines added in v2026.601.0

func ColorizeErrorLines(s string) string

func ColorizeImgTags

func ColorizeImgTags(s string) string

func ColorizeImgTagsReplInput

func ColorizeImgTagsReplInput(s string) string

func ColorizeReplInputTags added in v2026.606.3

func ColorizeReplInputTags(s string) string

func EditFileDeleteToolLine added in v2026.606.1

func EditFileDeleteToolLine(path string) string

func Enabled

func Enabled() bool

func ForegroundRGB

func ForegroundRGB(r, g, b uint8) string

func FormatRedBlock added in v2026.621.0

func FormatRedBlock(message string) string

func FormatSystemBlock

func FormatSystemBlock(message string) string

func FormatWorkedDuration

func FormatWorkedDuration(secs float64) string

func GoComment added in v2026.610.0

func GoComment(s string) string

func GoFunction added in v2026.610.0

func GoFunction(s string) string

func GoKeyword added in v2026.610.0

func GoKeyword(s string) string

func GoNumber added in v2026.610.0

func GoNumber(s string) string

func GoParen added in v2026.613.0

func GoParen(s string, depth int) string

func GoPlain added in v2026.610.0

func GoPlain(s string) string

func GoString added in v2026.610.0

func GoString(s string) string

func Init

func Init(opts InitOptions)

func IsEditLineDisplay added in v2026.613.0

func IsEditLineDisplay(s string) bool

func OrchestrateCodeFooterLine added in v2026.610.0

func OrchestrateCodeFooterLine() string

func OrchestrateCodeLabel added in v2026.610.0

func OrchestrateCodeLabel(s string) string

func OrchestrateToolHeaderLine added in v2026.610.0

func OrchestrateToolHeaderLine() string

func Plain

func Plain(s string) string

func PrintBtwSeparator added in v2026.621.0

func PrintBtwSeparator(out io.Writer)

func PrintBtwSeparatorSized added in v2026.621.0

func PrintBtwSeparatorSized(out io.Writer, termW int)

func PrintChatSeparator added in v2026.621.0

func PrintChatSeparator(out io.Writer)

func PrintChatSeparatorSized added in v2026.621.0

func PrintChatSeparatorSized(out io.Writer, termW int)

func REPLRawStdout added in v2026.608.1

func REPLRawStdout() bool

func ResetSeq

func ResetSeq() string

func RewrapEditLineLike added in v2026.613.0

func RewrapEditLineLike(sampleStyled, plainChunk string) string

func SetREPLRawStdout added in v2026.608.1

func SetREPLRawStdout(v bool)

func SwitchModeToolHeaderLine added in v2026.610.0

func SwitchModeToolHeaderLine(modeLabel string) string

func SystemMessageText

func SystemMessageText(v any) string

func ThoughtForSuffix

func ThoughtForSuffix(secs float64) string

func ToolHeaderLine

func ToolHeaderLine(toolName, body string) string

func ToolHeaderRedArgLine added in v2026.613.0

func ToolHeaderRedArgLine(toolName, arg string) string

func ToolLine

func ToolLine(toolName, body string) string

func UsageTokensLine

func UsageTokensLine(contextPromptTok, lastUserPromptTok, reasoningTokens, responseTokens, totalTokens int64, outputTPS, ttftSecs, promptTPS float64, contextEstimated bool, turnWallSecs float64) string

func WelcomeUsageTotals

func WelcomeUsageTotals(userTok, reasoningTok, responseTok, totalTok int64) string

func WrapAssistant

func WrapAssistant(s string) string

func WrapBoldGold

func WrapBoldGold(s string) string

func WrapContext

func WrapContext(s string) string

func WrapEditFileNewString added in v2026.602.2

func WrapEditFileNewString(s string) string

func WrapEditFileNewStringLine added in v2026.613.0

func WrapEditFileNewStringLine(s string) string

func WrapEditFileOldString added in v2026.602.2

func WrapEditFileOldString(s string) string

func WrapEditFileOldStringLine added in v2026.613.0

func WrapEditFileOldStringLine(s string) string

func WrapImgTag

func WrapImgTag(tag string) string

func WrapRed

func WrapRed(s string) string

func WrapSystem

func WrapSystem(s string) string

func WrapThinking

func WrapThinking(s string) string

func WrapTool

func WrapTool(s string) string

func WrapUser

func WrapUser(s string) string

func WrapUserReadline

func WrapUserReadline(s string) string

func WrapWhite

func WrapWhite(s string) string

func WriteRedBlock added in v2026.621.0

func WriteRedBlock(w io.Writer, message string)

func WriteSystem

func WriteSystem(w io.Writer, message string)

func ZshStyle added in v2026.606.0

func ZshStyle(key ZshStyleKey, s string) string

Types

type ErrorLineWriter added in v2026.601.0

type ErrorLineWriter struct {
	W io.Writer
	// contains filtered or unexported fields
}

func NewErrorLineWriter added in v2026.601.0

func NewErrorLineWriter(w io.Writer) *ErrorLineWriter

func (*ErrorLineWriter) Flush added in v2026.601.0

func (w *ErrorLineWriter) Flush() error

func (*ErrorLineWriter) Write added in v2026.601.0

func (w *ErrorLineWriter) Write(p []byte) (int, error)

type InitOptions

type InitOptions struct {
	Out        io.Writer
	NoColor    bool
	ForceColor bool
}

type ToolLineWriter

type ToolLineWriter struct {
	W io.Writer
	// contains filtered or unexported fields
}

func NewToolLineWriter

func NewToolLineWriter(w io.Writer) *ToolLineWriter

func (*ToolLineWriter) Flush

func (w *ToolLineWriter) Flush() error

func (*ToolLineWriter) Write

func (w *ToolLineWriter) Write(p []byte) (int, error)

type ZshStyleKey added in v2026.606.0

type ZshStyleKey string
const (
	ZshUnknownToken       ZshStyleKey = "unknown-token"
	ZshReservedWord       ZshStyleKey = "reserved-word"
	ZshArg0               ZshStyleKey = "arg0"
	ZshBuiltin            ZshStyleKey = "builtin"
	ZshPath               ZshStyleKey = "path"
	ZshPathPrefix         ZshStyleKey = "path_prefix"
	ZshGlobbing           ZshStyleKey = "globbing"
	ZshSingleQuoted       ZshStyleKey = "single-quoted-argument"
	ZshDoubleQuoted       ZshStyleKey = "double-quoted-argument"
	ZshDollarDoubleQuoted ZshStyleKey = "dollar-double-quoted-argument"
	ZshRedirection        ZshStyleKey = "redirection"
	ZshCommandSeparator   ZshStyleKey = "commandseparator"
	ZshComment            ZshStyleKey = "comment"
	ZshDefault            ZshStyleKey = "default"
)

Jump to

Keyboard shortcuts

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