diff --git a/butterfish/commands.go b/butterfish/commands.go index d282400..7f0fcf2 100644 --- a/butterfish/commands.go +++ b/butterfish/commands.go @@ -613,12 +613,13 @@ func (this *ButterfishCtx) Prompt(cmd *promptCommand) (*util.CompletionResponse, if !cmd.NoColor { color := styleToEscape(this.Config.Styles.Answer.GetForeground()) + highlight := styleToEscape(this.Config.Styles.Highlight.GetForeground()) this.Out.Write([]byte(color)) termWidth, _, _ := term.GetSize(int(os.Stdout.Fd())) if termWidth > 0 { - writer = util.NewStyleCodeblocksWriter(this.Out, termWidth, color) + writer = util.NewStyleCodeblocksWriter(this.Out, termWidth, color, highlight) } } else if cmd.NoBackticks { // this is an else because the code blocks writer will strip out backticks diff --git a/butterfish/shell.go b/butterfish/shell.go index 24a0723..e6c7354 100644 --- a/butterfish/shell.go +++ b/butterfish/shell.go @@ -52,7 +52,8 @@ var DarkShellColorScheme = &ShellColorScheme{ PromptGoalUnsafe: "\x1b[38;5;9m", Command: "\x1b[0m", Autosuggest: "\x1b[38;5;241m", - Answer: "\x1b[38;5;178m", + Answer: "\x1b[38;5;221m", + AnswerHighlight: "\x1b[38;5;204m", GoalMode: "\x1b[38;5;51m", Error: "\x1b[38;5;196m", } @@ -63,7 +64,8 @@ var LightShellColorScheme = &ShellColorScheme{ PromptGoalUnsafe: "\x1b[38;5;9m", Command: "\x1b[0m", Autosuggest: "\x1b[38;5;241m", - Answer: "\x1b[38;5;178m", + Answer: "\x1b[38;5;221m", + AnswerHighlight: "\x1b[38;5;204m", GoalMode: "\x1b[38;5;18m", Error: "\x1b[38;5;196m", } @@ -341,6 +343,7 @@ type ShellColorScheme struct { Command string Autosuggest string Answer string + AnswerHighlight string GoalMode string } @@ -587,7 +590,7 @@ func (this *ButterfishCtx) ShellMultiplexer( carriageReturnWriter := util.NewReplaceWriter(parentOut, "\n", "\r\n") styleCodeblocksWriter := util.NewStyleCodeblocksWriter(carriageReturnWriter, - termWidth, colorScheme.Answer) + termWidth, colorScheme.Answer, colorScheme.AnswerHighlight) sigwinch := make(chan os.Signal, 1) signal.Notify(sigwinch, syscall.SIGWINCH) diff --git a/util/util.go b/util/util.go index 93d0d5f..7908584 100644 --- a/util/util.go +++ b/util/util.go @@ -261,7 +261,12 @@ type StyleCodeblocksWriter struct { blockBuffer *bytes.Buffer } -func NewStyleCodeblocksWriter(writer io.Writer, terminalWidth int, normalColor string) *StyleCodeblocksWriter { +func NewStyleCodeblocksWriter( + writer io.Writer, + terminalWidth int, + normalColor string, + highlightColor string, +) *StyleCodeblocksWriter { if terminalWidth == 0 { panic("terminal width must be > 0") } @@ -270,7 +275,7 @@ func NewStyleCodeblocksWriter(writer io.Writer, terminalWidth int, normalColor s Writer: writer, state: STATE_NEWLINE, normalColor: normalColor, - inlineColor: "\x1b[93m", // bright yellow + inlineColor: highlightColor, terminalWidth: terminalWidth, } } diff --git a/util/util_test.go b/util/util_test.go index b03ce6f..529cc70 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -9,7 +9,7 @@ import ( func TestStyleCodeblocksWriter(t *testing.T) { buffer := new(bytes.Buffer) - writer := NewStyleCodeblocksWriter(buffer, 80, "") + writer := NewStyleCodeblocksWriter(buffer, 80, "", "") writer.Write([]byte("Hello\n")) writer.Write([]byte("```javascript\n"))