Skip to content

Terminal multiplexer zellij injects random input to input widget on auto-focus #5500

Closed
@isd-project

Description

@isd-project

Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed

  • yes

Have you checked against the most recent version of Textual? https://pypi.org/search/?q=textual

  • yes

Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.

Hey 👋

First, I am cross-posting the bug here for completeness and to learn if there are possible workarounds from the textual site.

If one runs the following input.py example with zellij:

from textual.app import App, ComposeResult
from textual.widgets import Input
from time import sleep


class InputApp(App):
    def compose(self) -> ComposeResult:
        yield Input(placeholder="First Name")
        yield Input(placeholder="Last Name")
        # sleep(0.5)


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

The input widget receives the input: [2026;2$y, which I assume is an ansi escape code sequence.

However, adding a delay seems to help sometimes and the result is always fixed if a non-input widget is focused during startup.

The issue was first reported here: isd-project/isd#34

and I have also reported issue to zellij here: zellij-org/zellij#3959

It will be helpful if you run the following command and paste the results:

Textual Diagnostics

Versions

Name Value
Textual 1.0.0
Rich 13.9.4

Python

Name Value
Version 3.12.8
Implementation CPython
Compiler GCC 14.2.1 20241116
Executable /nix/store/7yn2igqsp8alx4ahlh9a0xf5j6y6ak0p-hello-world-dev-env/bin/python3.12

Operating System

Name Value
System Linux
Release 6.12.9-cachyos
Version #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 9 12:33:55 UTC 2025

Terminal

Name Value
Terminal Application ghostty (1.0.2-72d0855-nix)
TERM xterm-ghostty
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

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

If you don't have the textual command on your path, you may have forgotten to install the textual-dev package.

Feel free to add screenshots and / or videos. These can be very helpful!

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