Skip to content

# feat: add WithoutCaps() for disabling specific terminal caps#1641

Open
mikeschinkel wants to merge 1 commit intocharmbracelet:mainfrom
mikeschinkel:feat/without-caps
Open

# feat: add WithoutCaps() for disabling specific terminal caps#1641
mikeschinkel wants to merge 1 commit intocharmbracelet:mainfrom
mikeschinkel:feat/without-caps

Conversation

@mikeschinkel
Copy link
Copy Markdown

@mikeschinkel mikeschinkel commented Mar 25, 2026

feat: add WithoutCaps() program option for disabling specific terminal capabilities

Depends on: charmbracelet/ultraviolet#100DisableCaps() must be merged first, then the ultraviolet dependency updated via go get and go mod tidy.

Summary

  • Add WithoutCaps(...uv.Capability) program option so developers can selectively disable terminal capabilities that cause rendering issues on specific terminals
  • Capabilities are applied to the renderer on initialization and preserved across renderer resets

Motivation

Some terminal emulators report a standard TERM value (e.g. xterm-256color) while not correctly implementing all the capabilities that implies. Currently there is no way for a Bubble Tea application to selectively disable specific rendering optimizations — the only workaround is overriding TERM to a less capable terminal type, which degrades the entire rendering pipeline (e.g. losing TrueColor).

WithoutCaps() provides fine-grained control: disable only the problematic capability while keeping everything else at full quality.

Example: JetBrains GoLand and all IntelliJ-based IDEs use JediTerm, which reports as xterm-256color but mishandles CBT (Cursor Backward Tab), causing invalid rendering. A follow-up ultraviolet PR will add auto-detection for known problematic terminals; this PR provides the Bubble Tea-level API that lets developers handle cases not yet auto-detected.

Usage

import uv "github.com/charmbracelet/ultraviolet"

// Disable CBT for terminals that don't support it
p = tea.NewProgram(model, tea.WithoutCaps(uv.CapCBT))

Changes

  • options.go — New WithoutCaps(...uv.Capability) program option for manual capability control.
  • options_test.go — Tests for WithoutCaps.
  • cursed_renderer.go — New setDisabledCaps() method that stores and applies disabled caps. Also applied during reset() so caps survive renderer recreation.
  • tea.go — New disabledCaps []uv.Capability field on Program.

Before merging

Once ultraviolet PR #100 is merged then you need to run go get github.com/charmbracelet/ultraviolet@<commit> , followed by go mod tidy.

Test plan

  • Manual testing with JediTerm (GoLand terminal) confirms rendering issue is resolved
  • All existing tests pass

Add tea.WithoutCaps() ProgramOption to selectively disable
ultraviolet terminal capabilities. This enables workarounds
for terminal emulators that mishandle specific escape
sequences without disabling all optimizations.
@mikeschinkel mikeschinkel changed the title feat: add WithoutCaps() to work around broken GoLand/JetBrains Run/Debug TTY # feat: add WithoutCaps() for disabling specific terminal caps Mar 25, 2026
@aymanbagabas
Copy link
Copy Markdown
Contributor

Hi @mikeschinkel, I opened JetBrains/jediterm#331 to fix this upstream in JediTerm 🙂

@mikeschinkel
Copy link
Copy Markdown
Author

@aymanbagabas — Very cool, thank you.

Now let’s see if JetBrains will prioritize evaluating it. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants