-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
Tab characters in string views seem to be omitted.
Setup
macOS, nushell, ghostty 2
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Source Code
package main
import (
"github.com/charmbracelet/bubbletea/v2"
)
type model struct {
}
func (m *model) Init() tea.Cmd {
return nil
}
func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "q", "esc", "ctrl+c":
return m, tea.Quit
}
}
return m, nil
}
func (m *model) View() tea.View {
return tea.NewView("Hi there")
}
func main() {
p := tea.NewProgram(&model{})
p.Run()
}Expected behavior
Expected behavior would be to print out a tab character between "Hi" and "there", something like:
Hi there
Instead it prints out:
Hithere
Screenshots
Additional context
In the debugger, I tracked this down as far as github.com/charmbracelent/ultraviolet/styled.go#printString, around this code:
The cell's contents are set to the "\t" character, but that cell is not set in the screen. In the next loop, the cell's contents are overwritten with the next character.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels