charmbracelet / charmbracelet/bubbletea

Disable canSkip as an option

Open
#1,501 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
44.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Yes. If you first write this to the renderer:
```
hello there1
hello there2
hello there3
```

followed by this:

```
\x1b[48;2;0;0;255;mhello there1
hello there2
hello there3\x1b[49m
```

_Then `hello there2` does not get any background_ in either iTerm2 nor Ghostty.

This is because the line is skipped for rendering here:
https://github.com/charmbracelet/bubbletea/blob/e5fb1b8ff58ea4fc17c48c91c800d48046336e26/standard_renderer.go#L217

**Describe the solution you'd like**
I suggest an option flag to simply disable the canSkip.

**Describe alternatives you've considered**
I have considered adding the background color to each line, but that would be really combersome for my usecase, since it is a complex scenario where the background colors are not known when i pass the final string in my main `View()` function.

**If you agree to the suggestion, i can make a PR with the feature**

Contributor guide

Open the contributing guide

Research direction

Start in standard_renderer.go around line 217 and inspect how the renderer options control canSkip. Reproduce the multiline background-color example in a terminal such as iTerm2 or Ghostty, then verify that the new option prevents the affected line from being skipped while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.