-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
Describe the bug
When using the auto style, with the textinput bubble, it'll get wedged and start spewing OSC on the screen.
Setup
Please complete the following information along with version numbers, if applicable.
- macOS 15.3.2
- zsh
- iTerm2
To Reproduce
Use the source below and run
$ go run main.go
bug
> ]11;rgb:0000/0000/0000\]11;rgb:0000/0000/0000\rgb:0000/0000/0000
Source Code
package main
import (
"fmt"
"os"
"strings"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/lipgloss"
)
type model struct{ input textinput.Model }
func (m model) Init() tea.Cmd { return nil }
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
switch t := msg.(type) {
case tea.KeyMsg:
switch t.Type {
case tea.KeyEsc:
return m, tea.Quit
}
}
m.input, cmd = m.input.Update(msg)
return m, cmd
}
func (m model) View() string {
if _, err := glamour.Render("", "auto"); err != nil {
panic(err)
}
var sb strings.Builder
sb.WriteString(lipgloss.NewStyle().Foreground(lipgloss.Color("1")).Render("bug"))
sb.WriteString("\n")
sb.WriteString(m.input.View())
return sb.String()
}
func main() {
input := textinput.New()
input.Focus()
p := tea.NewProgram(model{input})
if _, err := p.Run(); err != nil {
fmt.Printf("error: %v", err)
os.Exit(1)
}
}
Expected behavior
You should not see OSC output
Screenshots
Additional context
If you switch from auto to e.g. dark, it works as expected.
killeik
Metadata
Metadata
Assignees
Labels
No labels