Skip to content

regression: undercurl not properly rendered with small font sizes #9394

@mitchellh

Description

@mitchellh

Discussed in #9384

Originally posted by luisdavim October 29, 2025

Issue Description

I have this in my tmux config:

# Undercurl
if-shell '[[ "$(uname -o)" != "Android" ]]' {
  # set -g default-terminal tmux-256color
  set -g default-terminal "${TERM}"
  set -as terminal-overrides ',*256col*:RGB'
  set -as terminal-overrides ',*:sitm=\E[3m' # Italics support for older ncurses
  set -as terminal-overrides ',*:smxx=\E[9m' # Strikeout
  set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
  set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colours - needs tmux-3.0
}

and it results in:

# tmux show -s
backspace C-?
buffer-limit 50
command-alias[0] split-pane=split-window
command-alias[1] splitp=split-window
command-alias[2] "server-info=show-messages -JT"
command-alias[3] "info=show-messages -JT"
command-alias[4] "choose-window=choose-tree -w"
command-alias[5] "choose-session=choose-tree -s"
copy-command ''
default-terminal xterm-ghostty
editor nvim
escape-time 10
exit-empty on
exit-unattached off
extended-keys off
extended-keys-format xterm
focus-events on
history-file ''
message-limit 1000
prefix-timeout 0
prompt-history-limit 100
set-clipboard on
terminal-overrides[0] linux*:AX@
terminal-overrides[1] *256col*:RGB
terminal-overrides[2] *:sitm=\\E[3m
terminal-overrides[3] *:smxx=\\E[9m
terminal-overrides[4] "*:Smulx=\\E[4::%p1%dm"
terminal-overrides[5] "*:Setulc=\\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m"
terminal-overrides[6] *256col*:Tc
terminal-features[0] xterm*:clipboard:ccolour:cstyle:focus:title
terminal-features[1] screen*:title
terminal-features[2] rxvt*:ignorefkeys
user-keys

but instead of an undercul, when running:

echo -e '\e[4:3m\e[58:2::240:143:104mfoobarbaz\e[59m\e[4:0m\n'

I get the word underlined with a dashed line, same issue in neovim...
image

The same config works in kitty:
image

it seems like the issue is the font size, it seems like with relatively small font sizes, the undercurl gets trimmed and we only see the top of it, making it look like a dashed line.
But it only seems to display the undercurl correctly at ridiculously large font sizes, from about 21, I'm using:

# Fonts
font-family = JetBrainsMono Nerd Font Mono
font-family-bold = JetBrainsMono NFM Bold
font-family-italic = JetBrainsMono NFM Italic
font-family-bold-italic = JetBrainsMono NFM Bold Italic

font-size = 14
font-thicken = true

From what I gathered, this has been an issue before and it as been solved at least once so I think it's a regression.
I have also tested this without tmux and the issue is still reproducible.

Expected Behavior

The uundercurl should be rendered properly at any font size

Actual Behavior

The undercurl is only properly rendered at very large font sizes.

Reproduction Steps

  1. Open ghostty (I'm not sure if this only affects tmux)
  2. run: echo -e '\e[4:3m\e[58:2::240:143:104mfoobarbaz\e[59m\e[4:0m\n'
  3. see the result

I haven't checked this outside of tmux yet so I'm not sure if the issue is only present when running tmux.
The issue is also present without tmux.

Ghostty Logs

No response

Ghostty Version

Ghostty 1.3.0-main+d62235cb6

Version
  - version: 1.3.0-main+d62235cb6
  - channel: tip
Build Config
  - Zig version   : 0.15.2
  - build mode    : .ReleaseFast
  - app runtime   : .none
  - font engine   : .coretext
  - renderer      : renderer.generic.Renderer(renderer.Metal)
  - libxev        : kqueue

OS Version Information

macOS 26.0.1 25A362 arm64

(Linux only) Display Server

None

(Linux only) Desktop Environment/Window Manager

No response

Minimal Ghostty Configuration

font-family = JetBrainsMono Nerd Font Mono
font-family-bold = JetBrainsMono NFM Bold
font-family-italic = JetBrainsMono NFM Italic
font-family-bold-italic = JetBrainsMono NFM Bold Italic

font-size = 14
font-thicken = true

Additional Relevant Configuration

I use https://github.com/gpakosz/.tmux

with: https://github.com/luisdavim/dotfiles/blob/master/files/shell/tmux.conf.local

I acknowledge that:

  • I have reviewed the FAQ and confirm that my issue is NOT among them.
  • I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
  • I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (```) on separate lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fontIssue within the font stack (typically src/font)renderer

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions