Skip to content

[BUG] Using input placeholder text with ansi will crash the app #6077

@wilrodriguez

Description

@wilrodriguez

The bug

The bug actually is as simple as the title says. Using a placeholder with input widgets while ansi_color is set to true on the app will cause a crash. This is because the compositing fails to actually compute a color, due to that whole business being disabled in ansi_color mode. Below is a simple reproduction:

from textual.app import App, ComposeResult
from textual.widgets import Footer, Header, Input


class PlaceholderCrashApp(App):
    """A minimal app to demonstrate the placeholder crash."""

    ansi_color = True

    def compose(self) -> ComposeResult:
        yield Header()
        yield Input(placeholder="This placeholder will cause a crash in ANSI mode")
        yield Footer()


if __name__ == "__main__":
    app = PlaceholderCrashApp()
    app.run()

And here's the diagnose for my system I'm testing on. Note that I'm not using the latest textual, but there haven't been any changes that should have any impact on this behavior in recent releases.

Textual Diagnostics

Versions

Name Value
Textual 5.1.0
Rich 14.0.0

Python

Name Value
Version 3.9.21
Implementation CPython
Compiler GCC 11.5.0 20240719 (Red Hat 11.5.0-5)
Executable /opt/jcrsd_python/.venv/bin/python

Operating System

Name Value
System Linux
Release 5.14.0-570.26.1.el9_6.x86_64
Version #1 SMP PREEMPT_DYNAMIC Wed Jul 16 21:00:44 UTC 2025

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM Not set
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=160, height=53
legacy_windows False
min_width 1
max_width 160
is_terminal True
encoding utf-8
max_height 53
justify None
overflow None
no_wrap False
highlight None
markup None
height None

Last but not least, here's the traceback that is produced by this:

╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────╮
│ /path/to/.venv/lib/python3.9/site-packages/textual/widget.py:4091 in render_lines                                                                   │
│                                                                                                                                                              │
│   4088 │   │   Returns:                                                                         ╭───────────────────── locals ─────────────────────╮         │
│   4089 │   │   │   A list of list of segments.                                                  │ crop = Region(x=0, y=0, width=80, height=3)      │         │
│   4090 │   │   """                                                                              │ self = Input(id='scp-path', classes='scp-input') │         │
│ ❱ 4091 │   │   strips = self._styles_cache.render_widget(self, crop)                            ╰──────────────────────────────────────────────────╯         │
│   4092 │   │   return strips                                                                                                                                 │
│   4093 │                                                                                                                                                     │
│   4094 │   def get_style_at(self, x: int, y: int) -> Style:                                                                                                  │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/_styles_cache.py:127 in render_widget                                                            │
│                                                                                                                                                              │
│   124 │   │                                                                                                                                                  │
│   125 │   │   base_background, background = widget._opacity_background_colors                                                                                │
│   126 │   │   styles = widget.styles                                                                                                                         │
│ ❱ 127 │   │   strips = self.render(                                                                                                                          │
│   128 │   │   │   styles,                                                                                                                                    │
│   129 │   │   │   widget.region.size,                                                                                                                        │
│   130 │   │   │   base_background,                                                                                                                           │
│                                                                                                                                                              │
│ ╭─────────────────────────────────────────────── locals ───────────────────────────────────────────────╮                                                     │
│ │      background = Color(0, 0, 0, ansi=-1)                                                            │                                                     │
│ │ base_background = Color(52, 63, 73)                                                                  │                                                     │
│ │ border_subtitle = None                                                                               │                                                     │
│ │    border_title = None                                                                               │                                                     │
│ │            crop = Region(x=0, y=0, width=80, height=3)                                               │                                                     │
│ │            self = <StylesCache width=80>                                                             │                                                     │
│ │          styles = RenderStyles(                                                                      │                                                     │
│ │                   │   Input(id='scp-path', classes='scp-input'),                                     │                                                     │
│ │                   │   layout=<vertical>,                                                             │                                                     │
│ │                   │   auto_color=False,                                                              │                                                     │
│ │                   │   color=Color(0, 0, 0, ansi=-1),                                                 │                                                     │
│ │                   │   background=Color(0, 0, 0, ansi=-1),                                            │                                                     │
│ │                   │   padding=Spacing(top=0, right=2, bottom=0, left=2),                             │                                                     │
│ │                   │   margin=Spacing(top=0, right=0, bottom=1, left=0),                              │                                                     │
│ │                   │   border_top=('tall', Color(25, 25, 25)),                                        │                                                     │
│ │                   │   border_right=('tall', Color(25, 25, 25)),                                      │                                                     │
│ │                   │   border_bottom=('tall', Color(25, 25, 25)),                                     │                                                     │
│ │                   │   border_left=('tall', Color(25, 25, 25)),                                       │                                                     │
│ │                   │   width=Scalar(                                                                  │                                                     │
│ │                   │   │   value=100.0,                                                               │                                                     │
│ │                   │   │   unit=<Unit.WIDTH: 4>,                                                      │                                                     │
│ │                   │   │   percent_unit=<Unit.WIDTH: 4>                                               │                                                     │
│ │                   │   ),                                                                             │                                                     │
│ │                   │   height=Scalar(value=3.0, unit=<Unit.CELLS: 1>, percent_unit=<Unit.WIDTH: 4>),  │                                                     │
│ │                   │   overflow_x='auto',                                                             │                                                     │
│ │                   │   overflow_y='auto',                                                             │                                                     │
│ │                   │   scrollbar_color=Color(0, 48, 84),                                              │                                                     │
│ │                   │   scrollbar_color_hover=Color(0, 60, 106),                                       │                                                     │
│ │                   │   scrollbar_color_active=Color(1, 120, 212),                                     │                                                     │
│ │                   │   scrollbar_corner_color=Color(0, 0, 0),                                         │                                                     │
│ │                   │   scrollbar_background=Color(0, 0, 0),                                           │                                                     │
│ │                   │   scrollbar_background_hover=Color(0, 0, 0),                                     │                                                     │
│ │                   │   scrollbar_background_active=Color(0, 0, 0),                                    │                                                     │
│ │                   │   scrollbar_size_vertical=2,                                                     │                                                     │
│ │                   │   scrollbar_size_horizontal=0,                                                   │                                                     │
│ │                   │   link_color=Color(255, 255, 255, a=0.87),                                       │                                                     │
│ │                   │   auto_link_color=True,                                                          │                                                     │
│ │                   │   link_background=Color(0, 0, 0, a=0),                                           │                                                     │
│ │                   │   link_style=Style(underline=True),                                              │                                                     │
│ │                   │   link_color_hover=Color(255, 255, 255, a=0.87),                                 │                                                     │
│ │                   │   auto_link_color_hover=True,                                                    │                                                     │
│ │                   │   link_background_hover=Color(1, 120, 212),                                      │                                                     │
│ │                   │   link_style_hover=Style(bold=True, underline=False)                             │                                                     │
│ │                   )                                                                                  │                                                     │
│ │          widget = Input(id='scp-path', classes='scp-input')                                          │                                                     │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                     │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/_styles_cache.py:250 in render                                                                   │
│                                                                                                                                                              │
│   247 │   │   │   │   strip = self._cache[y]                                                                                                                 │
│   248 │   │   │                                                                                                                                              │
│   249 │   │   │   for filter in apply_filters:                                                                                                               │
│ ❱ 250 │   │   │   │   strip = strip.apply_filter(filter, background)                                                                                         │
│   251 │   │   │                                                                                                                                              │
│   252 │   │   │   if DEBUG:                                                                                                                                  │
│   253 │   │   │   │   if any([not (segment.control or segment.text) for segment in strip]):                                                                  │
│                                                                                                                                                              │
│ ╭───────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────╮                │
│ │             _height = 3                                                                                                                   │                │
│ │           add_strip = <built-in method append of list object at 0x7ff5a2f30a80>                                                           │                │
│ │          ansi_theme = <rich.terminal_theme.TerminalTheme object at 0x7ff5a7877640>                                                        │                │
│ │       apply_filters = [<textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>]                                                         │                │
│ │          background = Color(0, 0, 0, ansi=-1)                                                                                             │                │
│ │     base_background = Color(52, 63, 73)                                                                                                   │                │
│ │     border_subtitle = None                                                                                                                │                │
│ │        border_title = None                                                                                                                │                │
│ │        content_size = Size(width=74, height=1)                                                                                            │                │
│ │                crop = Region(x=0, y=0, width=80, height=3)                                                                                │                │
│ │              filter = <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>                                                           │                │
│ │             filters = [<textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>]                                                         │                │
│ │            is_dirty = <built-in method __contains__ of set object at 0x7ff5a2a3b120>                                                      │                │
│ │             opacity = 1.0                                                                                                                 │                │
│ │             padding = Spacing(top=0, right=2, bottom=0, left=2)                                                                           │                │
│ │ render_content_line = <bound method Input.render_line of Input(id='scp-path', classes='scp-input')>                                       │                │
│ │         render_line = <bound method StylesCache.render_line of <StylesCache width=80>>                                                    │                │
│ │                self = <StylesCache width=80>                                                                                              │                │
│ │                size = Size(width=80, height=3)                                                                                            │                │
│ │               strip = Strip(                                                                                                              │                │
│ │                       │   [                                                                                                               │                │
│ │                       │   │   Segment(                                                                                                    │                │
│ │                       │   │   │   '▊',                                                                                                    │                │
│ │                       │   │   │   Style(                                                                                                  │                │
│ │                       │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                │
│ │                       │   │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73)),     │                │
│ │                       │   │   │   │   reverse=True                                                                                        │                │
│ │                       │   │   │   )                                                                                                       │                │
│ │                       │   │   ),                                                                                                          │                │
│ │                       │   │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                │
│ │                       │   │   Segment(                                                                                                    │                │
│ │                       │   │   │   'Remote File Path',                                                                                     │                │
│ │                       │   │   │   Style(                                                                                                  │                │
│ │                       │   │   │   │   color=Color('default', ColorType.DEFAULT),                                                          │                │
│ │                       │   │   │   │   bgcolor=Color('default', ColorType.DEFAULT),                                                        │                │
│ │                       │   │   │   │   dim=True                                                                                            │                │
│ │                       │   │   │   )                                                                                                       │                │
│ │                       │   │   ),                                                                                                          │                │
│ │                       │   │   Segment(                                                                                                    │                │
│ │                       │   │   │   '                                                          ',                                           │                │
│ │                       │   │   │   Style(color=Color('default', ColorType.DEFAULT), bgcolor=Color('default', ColorType.DEFAULT))           │                │
│ │                       │   │   ),                                                                                                          │                │
│ │                       │   │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                │
│ │                       │   │   Segment(                                                                                                    │                │
│ │                       │   │   │   '▎',                                                                                                    │                │
│ │                       │   │   │   Style(                                                                                                  │                │
│ │                       │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                │
│ │                       │   │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73))      │                │
│ │                       │   │   │   )                                                                                                       │                │
│ │                       │   │   )                                                                                                           │                │
│ │                       │   ],                                                                                                              │                │
│ │                       │   80                                                                                                              │                │
│ │                       )                                                                                                                   │                │
│ │              strips = [                                                                                                                   │                │
│ │                       │   Strip(                                                                                                          │                │
│ │                       │   │   [                                                                                                           │                │
│ │                       │   │   │   Segment(                                                                                                │                │
│ │                       │   │   │   │   '▊',                                                                                                │                │
│ │                       │   │   │   │   Style(                                                                                              │                │
│ │                       │   │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),   │                │
│ │                       │   │   │   │   │   bgcolor=Color(                                                                                  │                │
│ │                       │   │   │   │   │   │   '#343f49',                                                                                  │                │
│ │                       │   │   │   │   │   │   ColorType.TRUECOLOR,                                                                        │                │
│ │                       │   │   │   │   │   │   triplet=ColorTriplet(red=52, green=63, blue=73)                                             │                │
│ │                       │   │   │   │   │   ),                                                                                              │                │
│ │                       │   │   │   │   │   reverse=True                                                                                    │                │
│ │                       │   │   │   │   )                                                                                                   │                │
│ │                       │   │   │   ),                                                                                                      │                │
│ │                       │   │   │   Segment(                                                                                                │                │
│ │                       │   │   │   │   '▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔',                   │                │
│ │                       │   │   │   │   Style(                                                                                              │                │
│ │                       │   │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),   │                │
│ │                       │   │   │   │   │   bgcolor=Color(                                                                                  │                │
│ │                       │   │   │   │   │   │   '#0c0c0c',                                                                                  │                │
│ │                       │   │   │   │   │   │   ColorType.TRUECOLOR,                                                                        │                │
│ │                       │   │   │   │   │   │   triplet=ColorTriplet(red=12, green=12, blue=12)                                             │                │
│ │                       │   │   │   │   │   )                                                                                               │                │
│ │                       │   │   │   │   )                                                                                                   │                │
│ │                       │   │   │   ),                                                                                                      │                │
│ │                       │   │   │   Segment(                                                                                                │                │
│ │                       │   │   │   │   '▎',                                                                                                │                │
│ │                       │   │   │   │   Style(                                                                                              │                │
│ │                       │   │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),   │                │
│ │                       │   │   │   │   │   bgcolor=Color(                                                                                  │                │
│ │                       │   │   │   │   │   │   '#343f49',                                                                                  │                │
│ │                       │   │   │   │   │   │   ColorType.TRUECOLOR,                                                                        │                │
│ │                       │   │   │   │   │   │   triplet=ColorTriplet(red=52, green=63, blue=73)                                             │                │
│ │                       │   │   │   │   │   )                                                                                               │                │
│ │                       │   │   │   │   )                                                                                                   │                │
│ │                       │   │   │   )                                                                                                       │                │
│ │                       │   │   ],                                                                                                          │                │
│ │                       │   │   80                                                                                                          │                │
│ │                       │   )                                                                                                               │                │
│ │                       ]                                                                                                                   │                │
│ │              styles = RenderStyles(                                                                                                       │                │
│ │                       │   Input(id='scp-path', classes='scp-input'),                                                                      │                │
│ │                       │   layout=<vertical>,                                                                                              │                │
│ │                       │   auto_color=False,                                                                                               │                │
│ │                       │   color=Color(0, 0, 0, ansi=-1),                                                                                  │                │
│ │                       │   background=Color(0, 0, 0, ansi=-1),                                                                             │                │
│ │                       │   padding=Spacing(top=0, right=2, bottom=0, left=2),                                                              │                │
│ │                       │   margin=Spacing(top=0, right=0, bottom=1, left=0),                                                               │                │
│ │                       │   border_top=('tall', Color(25, 25, 25)),                                                                         │                │
│ │                       │   border_right=('tall', Color(25, 25, 25)),                                                                       │                │
│ │                       │   border_bottom=('tall', Color(25, 25, 25)),                                                                      │                │
│ │                       │   border_left=('tall', Color(25, 25, 25)),                                                                        │                │
│ │                       │   width=Scalar(value=100.0, unit=<Unit.WIDTH: 4>, percent_unit=<Unit.WIDTH: 4>),                                  │                │
│ │                       │   height=Scalar(value=3.0, unit=<Unit.CELLS: 1>, percent_unit=<Unit.WIDTH: 4>),                                   │                │
│ │                       │   overflow_x='auto',                                                                                              │                │
│ │                       │   overflow_y='auto',                                                                                              │                │
│ │                       │   scrollbar_color=Color(0, 48, 84),                                                                               │                │
│ │                       │   scrollbar_color_hover=Color(0, 60, 106),                                                                        │                │
│ │                       │   scrollbar_color_active=Color(1, 120, 212),                                                                      │                │
│ │                       │   scrollbar_corner_color=Color(0, 0, 0),                                                                          │                │
│ │                       │   scrollbar_background=Color(0, 0, 0),                                                                            │                │
│ │                       │   scrollbar_background_hover=Color(0, 0, 0),                                                                      │                │
│ │                       │   scrollbar_background_active=Color(0, 0, 0),                                                                     │                │
│ │                       │   scrollbar_size_vertical=2,                                                                                      │                │
│ │                       │   scrollbar_size_horizontal=0,                                                                                    │                │
│ │                       │   link_color=Color(255, 255, 255, a=0.87),                                                                        │                │
│ │                       │   auto_link_color=True,                                                                                           │                │
│ │                       │   link_background=Color(0, 0, 0, a=0),                                                                            │                │
│ │                       │   link_style=Style(underline=True),                                                                               │                │
│ │                       │   link_color_hover=Color(255, 255, 255, a=0.87),                                                                  │                │
│ │                       │   auto_link_color_hover=True,                                                                                     │                │
│ │                       │   link_background_hover=Color(1, 120, 212),                                                                       │                │
│ │                       │   link_style_hover=Style(bold=True, underline=False)                                                              │                │
│ │                       )                                                                                                                   │                │
│ │               width = 80                                                                                                                  │                │
│ │                   y = 1                                                                                                                   │                │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/strip.py:443 in apply_filter                                                                     │
│                                                                                                                                                              │
│   440 │   │   cached_strip = self._filter_cache.get((filter, background))                                                                                    │
│   441 │   │   if cached_strip is None:                                                                                                                       │
│   442 │   │   │   cached_strip = Strip(                                                                                                                      │
│ ❱ 443 │   │   │   │   filter.apply(self._segments, background), self._cell_length                                                                            │
│   444 │   │   │   )                                                                                                                                          │
│   445 │   │   │   self._filter_cache[(filter, background)] = cached_strip                                                                                    │
│   446 │   │   return cached_strip                                                                                                                            │
│                                                                                                                                                              │
│ ╭────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────╮                       │
│ │   background = Color(0, 0, 0, ansi=-1)                                                                                             │                       │
│ │ cached_strip = None                                                                                                                │                       │
│ │       filter = <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>                                                           │                       │
│ │         self = Strip(                                                                                                              │                       │
│ │                │   [                                                                                                               │                       │
│ │                │   │   Segment(                                                                                                    │                       │
│ │                │   │   │   '▊',                                                                                                    │                       │
│ │                │   │   │   Style(                                                                                                  │                       │
│ │                │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                       │
│ │                │   │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73)),     │                       │
│ │                │   │   │   │   reverse=True                                                                                        │                       │
│ │                │   │   │   )                                                                                                       │                       │
│ │                │   │   ),                                                                                                          │                       │
│ │                │   │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                       │
│ │                │   │   Segment(                                                                                                    │                       │
│ │                │   │   │   'Remote File Path',                                                                                     │                       │
│ │                │   │   │   Style(                                                                                                  │                       │
│ │                │   │   │   │   color=Color('default', ColorType.DEFAULT),                                                          │                       │
│ │                │   │   │   │   bgcolor=Color('default', ColorType.DEFAULT),                                                        │                       │
│ │                │   │   │   │   dim=True                                                                                            │                       │
│ │                │   │   │   )                                                                                                       │                       │
│ │                │   │   ),                                                                                                          │                       │
│ │                │   │   Segment(                                                                                                    │                       │
│ │                │   │   │   '                                                          ',                                           │                       │
│ │                │   │   │   Style(color=Color('default', ColorType.DEFAULT), bgcolor=Color('default', ColorType.DEFAULT))           │                       │
│ │                │   │   ),                                                                                                          │                       │
│ │                │   │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                       │
│ │                │   │   Segment(                                                                                                    │                       │
│ │                │   │   │   '▎',                                                                                                    │                       │
│ │                │   │   │   Style(                                                                                                  │                       │
│ │                │   │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                       │
│ │                │   │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73))      │                       │
│ │                │   │   │   )                                                                                                       │                       │
│ │                │   │   )                                                                                                           │                       │
│ │                │   ],                                                                                                              │                       │
│ │                │   80                                                                                                              │                       │
│ │                )                                                                                                                   │                       │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                       │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/filter.py:275 in apply                                                                           │
│                                                                                                                                                              │
│   272 │   │                                                                                                                                                  │
│   273 │   │   background_rich_color = background.rich_color                                                                                                  │
│   274 │   │                                                                                                                                                  │
│ ❱ 275 │   │   return [                                                                                                                                       │
│   276 │   │   │   _Segment(                                                                                                                                  │
│   277 │   │   │   │   text,                                                                                                                                  │
│   278 │   │   │   │   (                                                                                                                                      │
│                                                                                                                                                              │
│ ╭──────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────╮                  │
│ │            background = Color(0, 0, 0, ansi=-1)                                                                                         │                  │
│ │ background_rich_color = Color('default', ColorType.DEFAULT)                                                                             │                  │
│ │              segments = [                                                                                                               │                  │
│ │                         │   Segment(                                                                                                    │                  │
│ │                         │   │   '▊',                                                                                                    │                  │
│ │                         │   │   Style(                                                                                                  │                  │
│ │                         │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                  │
│ │                         │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73)),     │                  │
│ │                         │   │   │   reverse=True                                                                                        │                  │
│ │                         │   │   )                                                                                                       │                  │
│ │                         │   ),                                                                                                          │                  │
│ │                         │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                  │
│ │                         │   Segment(                                                                                                    │                  │
│ │                         │   │   'Remote File Path',                                                                                     │                  │
│ │                         │   │   Style(                                                                                                  │                  │
│ │                         │   │   │   color=Color('default', ColorType.DEFAULT),                                                          │                  │
│ │                         │   │   │   bgcolor=Color('default', ColorType.DEFAULT),                                                        │                  │
│ │                         │   │   │   dim=True                                                                                            │                  │
│ │                         │   │   )                                                                                                       │                  │
│ │                         │   ),                                                                                                          │                  │
│ │                         │   Segment(                                                                                                    │                  │
│ │                         │   │   '                                                          ',                                           │                  │
│ │                         │   │   Style(color=Color('default', ColorType.DEFAULT), bgcolor=Color('default', ColorType.DEFAULT))           │                  │
│ │                         │   ),                                                                                                          │                  │
│ │                         │   Segment('  ', Style(bgcolor=Color('default', ColorType.DEFAULT))),                                          │                  │
│ │                         │   Segment(                                                                                                    │                  │
│ │                         │   │   '▎',                                                                                                    │                  │
│ │                         │   │   Style(                                                                                                  │                  │
│ │                         │   │   │   color=Color('#191919', ColorType.TRUECOLOR, triplet=ColorTriplet(red=25, green=25, blue=25)),       │                  │
│ │                         │   │   │   bgcolor=Color('#343f49', ColorType.TRUECOLOR, triplet=ColorTriplet(red=52, green=63, blue=73))      │                  │
│ │                         │   │   )                                                                                                       │                  │
│ │                         │   )                                                                                                           │                  │
│ │                         ]                                                                                                               │                  │
│ │                  self = <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>                                                       │                  │
│ │       truecolor_style = <bound method ANSIToTruecolor.truecolor_style of <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>>     │                  │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                  │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/filter.py:281 in <listcomp>                                                                      │
│                                                                                                                                                              │
│   278 │   │   │   │   (                                                                                                                                      │
│   279 │   │   │   │   │   None                                                                                                                               │
│   280 │   │   │   │   │   if style is None                                                                                                                   │
│ ❱ 281 │   │   │   │   │   else truecolor_style(style, background_rich_color)                                                                                 │
│   282 │   │   │   │   ),                                                                                                                                     │
│   283 │   │   │   │   None,                                                                                                                                  │
│   284 │   │   │   )                                                                                                                                          │
│                                                                                                                                                              │
│ ╭────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────╮                      │
│ │                    .0 = <list_iterator object at 0x7ff5a2db4550>                                                                    │                      │
│ │                     _ = None                                                                                                        │                      │
│ │ background_rich_color = Color('default', ColorType.DEFAULT)                                                                         │                      │
│ │                 style = Style(color=Color('default', ColorType.DEFAULT), bgcolor=Color('default', ColorType.DEFAULT), dim=True)     │                      │
│ │                  text = 'Remote File Path'                                                                                          │                      │
│ │       truecolor_style = <bound method ANSIToTruecolor.truecolor_style of <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>> │                      │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                      │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/filter.py:255 in truecolor_style                                                                 │
│                                                                                                                                                              │
│   252 │   │   │   )                                                                                                                                          │
│   253 │   │   # Convert dim style to RGB                                                                                                                     │
│   254 │   │   if style.dim and color is not None:                                                                                                            │
│ ❱ 255 │   │   │   color = dim_color(background, color)                                                                                                       │
│   256 │   │   │   style += NO_DIM                                                                                                                            │
│   257 │   │                                                                                                                                                  │
│   258 │   │   return style + Style.from_color(color, bgcolor)                                                                                                │
│                                                                                                                                                              │
│ ╭───────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────╮                                 │
│ │     background = Color('default', ColorType.DEFAULT)                                                                     │                                 │
│ │        bgcolor = Color('#0c0c0c', ColorType.TRUECOLOR, triplet=ColorTriplet(red=12, green=12, blue=12))                  │                                 │
│ │          color = Color('#d9d9d9', ColorType.TRUECOLOR, triplet=ColorTriplet(red=217, green=217, blue=217))               │                                 │
│ │           self = <textual.filter.ANSIToTruecolor object at 0x7ff5a48212e0>                                               │                                 │
│ │          style = Style(color=Color('default', ColorType.DEFAULT), bgcolor=Color('default', ColorType.DEFAULT), dim=True) │                                 │
│ │ terminal_theme = <rich.terminal_theme.TerminalTheme object at 0x7ff5a7877640>                                            │                                 │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                 │
│                                                                                                                                                              │
│ /path/to/.venv/lib/python3.9/site-packages/textual/filter.py:142 in dim_color                                                                       │
│                                                                                                                                                              │
│   139 │   Returns:                                                                                                                                           │
│   140 │   │   New dimmer color.                                                                                                                              │
│   141 │   """                                                                                                                                                │
│ ❱ 142 │   red1, green1, blue1 = background.triplet                                                                                                           │
│   143 │   red2, green2, blue2 = color.triplet                                                                                                                │
│   144 │                                                                                                                                                      │
│   145 │   return RichColor.from_rgb(                                                                                                                         │
│                                                                                                                                                              │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                   │
│ │ background = Color('default', ColorType.DEFAULT)                                                       │                                                   │
│ │      color = Color('#d9d9d9', ColorType.TRUECOLOR, triplet=ColorTriplet(red=217, green=217, blue=217)) │                                                   │
│ │     factor = 0.66                                                                                      │                                                   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: cannot unpack non-iterable NoneType object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions