Skip to content

Commit 0c92bd3

Browse files
authored
Fixes #30 (#32)
1 parent a543ae6 commit 0c92bd3

File tree

7 files changed

+20
-25
lines changed

7 files changed

+20
-25
lines changed

internal/chat.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/alvinunreal/tmuxai/config"
1313
"github.com/alvinunreal/tmuxai/logger"
1414
"github.com/chzyer/readline"
15-
"github.com/fatih/color"
1615
)
1716

1817
// Message represents a chat message
@@ -86,10 +85,8 @@ func (c *CLIInterface) Start(initMessage string) error {
8685

8786
// printWelcomeMessage prints a welcome message
8887
func (c *CLIInterface) printWelcomeMessage() {
89-
infoColor := color.New(color.FgHiWhite)
9088
fmt.Println()
91-
92-
infoColor.Println("Type '/help' for a list of commands, '/exit' to quit")
89+
fmt.Println("Type '/help' for a list of commands, '/exit' to quit")
9390
fmt.Println()
9491
}
9592

internal/chat_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (m *Manager) formatInfo() {
164164
formatLine := func(key string, value any) {
165165
fmt.Print(formatter.LabelColor.Sprintf("%-*s", labelWidth, key))
166166
fmt.Print(" ")
167-
fmt.Println(formatter.ValueColor.Sprint(value))
167+
fmt.Println(value)
168168
}
169169
// Display general information
170170
fmt.Println(formatter.FormatSection("\nGeneral"))
@@ -186,7 +186,7 @@ func (m *Manager) formatInfo() {
186186
}
187187
fmt.Print(formatter.LabelColor.Sprintf("%-*s", labelWidth, "Context Size~"))
188188
fmt.Print(" ") // Two spaces for separation
189-
fmt.Printf("%s\n", formatter.ValueColor.Sprintf("%d tokens", totalTokens))
189+
fmt.Printf("%s\n", fmt.Sprintf("%d tokens", totalTokens))
190190
fmt.Printf("%-*s %s\n", labelWidth, "", formatter.FormatProgressBar(usagePercent, 10))
191191
formatLine("Max Size", fmt.Sprintf("%d tokens", m.GetMaxContextSize()))
192192

internal/confirm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (m *Manager) confirmedToExec(command string, prompt string, edit bool) (boo
1515
return true, command
1616
}
1717

18-
promptColor := color.New(color.FgHiCyan)
18+
promptColor := color.New(color.FgCyan, color.Bold)
1919

2020
var promptText string
2121
if edit {

internal/countdown.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
)
1111

1212
func (m *Manager) Countdown(seconds int) {
13-
highlightColor := color.New(color.FgHiYellow).SprintFunc()
14-
dimColor := color.New(color.FgHiBlack).SprintFunc()
15-
pauseColor := color.New(color.FgHiRed).SprintFunc()
13+
highlightColor := color.New(color.FgYellow, color.Bold).SprintFunc()
14+
dimColor := color.New(color.FgBlue).SprintFunc()
15+
pauseColor := color.New(color.FgRed, color.Bold).SprintFunc()
1616

1717
// Set up keyboard
1818
if err := keyboard.Open(); err != nil {

internal/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ func (m *Manager) GetConfig() *config.Config {
112112

113113
// getPrompt returns the prompt string with color
114114
func (m *Manager) GetPrompt() string {
115-
tmuxaiColor := color.New(color.FgHiGreen)
116-
arrowColor := color.New(color.FgHiYellow)
117-
stateColor := color.New(color.FgHiWhite)
115+
tmuxaiColor := color.New(color.FgGreen, color.Bold)
116+
arrowColor := color.New(color.FgYellow, color.Bold)
117+
stateColor := color.New(color.FgMagenta, color.Bold)
118118

119119
var stateSymbol string
120120
switch m.Status {

system/formatter.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type InfoFormatter struct {
1212
// Color schemes
1313
HeaderColor *color.Color
1414
LabelColor *color.Color
15-
ValueColor *color.Color
1615
SuccessColor *color.Color
1716
WarningColor *color.Color
1817
ErrorColor *color.Color
@@ -22,13 +21,12 @@ type InfoFormatter struct {
2221
// NewInfoFormatter creates a new formatter with default color schemes
2322
func NewInfoFormatter() *InfoFormatter {
2423
return &InfoFormatter{
25-
HeaderColor: color.New(color.FgHiCyan, color.Bold),
26-
LabelColor: color.New(color.FgHiBlue),
27-
ValueColor: color.New(color.FgHiWhite),
28-
SuccessColor: color.New(color.FgHiGreen),
29-
WarningColor: color.New(color.FgHiYellow),
30-
ErrorColor: color.New(color.FgHiRed),
31-
NeutralColor: color.New(color.FgHiBlack),
24+
HeaderColor: color.New(color.FgCyan, color.Bold),
25+
LabelColor: color.New(color.FgBlue, color.Bold),
26+
SuccessColor: color.New(color.FgGreen, color.Bold),
27+
WarningColor: color.New(color.FgYellow, color.Bold),
28+
ErrorColor: color.New(color.FgRed, color.Bold),
29+
NeutralColor: color.New(color.FgBlue),
3230
}
3331
}
3432

@@ -43,7 +41,7 @@ func (f *InfoFormatter) FormatSection(title string) string {
4341
func (f *InfoFormatter) FormatKeyValue(key string, value interface{}) string {
4442
return fmt.Sprintf("%s %s\n",
4543
f.LabelColor.Sprintf("%-16s:", key),
46-
f.ValueColor.Sprint(value))
44+
fmt.Sprint(value))
4745
}
4846

4947
// FormatProgressBar generates a visual indicator for percentage values
@@ -80,13 +78,13 @@ func (f *InfoFormatter) FormatProgressBar(percent float64, width int) string {
8078
bar += f.NeutralColor.Sprint(strings.Repeat("░", width-filled))
8179
}
8280

83-
return fmt.Sprintf("%s %s", bar, f.ValueColor.Sprintf("%.1f%%", percent))
81+
return fmt.Sprintf("%s %.1f%%", bar, percent)
8482
}
8583

8684
// FormatBool formats boolean values with color
8785
func (f *InfoFormatter) FormatBool(value bool) string {
8886
if value {
8987
return f.SuccessColor.Sprint("yes")
9088
}
91-
return f.NeutralColor.Sprint("no")
89+
return color.New(color.FgMagenta).Sprint("no")
9290
}

system/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (p *TmuxPaneDetails) FormatInfo(f *InfoFormatter) string {
7474
formatLine := func(key string, value any) {
7575
builder.WriteString(f.LabelColor.Sprintf("%-*s", labelWidth, key))
7676
builder.WriteString(" ")
77-
builder.WriteString(f.ValueColor.Sprint(value))
77+
builder.WriteString(value.(string))
7878
builder.WriteString("\n")
7979
}
8080

0 commit comments

Comments
 (0)