terminal-util: ANSI size query on container ttys leaves cursor-position replies in agetty login prompt

Aperta
#44,811 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

Start with the terminal-util code that sends the ANSI size query (CSI 18 / DSR) for container ttys, and the EAGAIN-to-retry change in commit ba10d78 referenced by PR 43802. Reproduce by running [email protected] in a container with a tty console and checking whether the login field is pre-filled with cursor-position replies. Done means no stray replies reach agetty on boot, while resizes still propagate after startup.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug 🐛 pid1
systemd version the issue has been seen with

262.1 (Fedora 45 container image). Not reproducible with 257.5 (Fedora 42).

Used distribution

Fedora 45 (container image). Also reported on Arch Linux containers by another user on the Proxmox forum.

Linux kernel version used

7.0.14-26-pve (Proxmox VE 9.2.24 host)

CPU architectures issue was seen on

x86_64

Component

systemd

Expected behaviour you didn't see

A clean login prompt on tty1 served by [email protected].


Also reported on Proxmox forum here: https://forum.proxmox.com/threads/troubleshooting-lxc-tty-terminal-login-prompt-shows-gibberish.178350/

Unexpected behaviour you saw

After a reboot with the Proxmox web console attached in "tty" mode, the login field is pre-filled with ^[[24;80R^[[24;80R, which is two DSR cursor-position reports. agetty stores them as username input. util-linux 2.40.3+ (commit 7b90601) makes them visible as "^["; older agetty versions echoed them invisibly but still stored them.

Login field without pre-filled text (Fedora 42):

image

Login field with pre-filled text (Fedora 45):

image
Steps to reproduce the problem
  1. Run a Fedora 45 LXC container on Proxmox VE 9.2.24 with console mode "tty".
  2. Reboot the container (not power-off) and open the web console while it boots.
  3. Observe the login prompt on tty1.
Additional program output to the terminal or log subsystem illustrating the issue
- A drop-in on [email protected] setting TTYRows=24 and TTYColumns=80 eliminates the issue on every reboot (values confirmed via busctl). This indicates the per-service ANSI terminal-size query (CSI 18 / DSR) is the source: the replies arrive after the query gives up and are read by agetty.
- With the pinned size, the console still tracks resizes after startup (stty size follows the browser window).
- The regression appeared between 257.5 and 258.x. PR 43802 notes a change from abandoning the query on EAGAIN to retrying until the timeout (commit ba10d78). That may be related, but it is unconfirmed.
- PR 43802 skips the query on virtual consoles only. Pseudo-terminals used as container ttys remain affected.
- Suggested fix: skip the query for container ttys, or flush tty input after the query times out.

Workaround:
# /etc/systemd/system/[email protected]/10-no-size-probe.conf
[Service]
TTYRows=24
TTYColumns=80

All testing and verification performed by me (the reporter). Diagnosis and write-up assisted by Claude Opus 5.5 (Anthropic).
Lingua principale
C
Stelle
17k
Fork
4.8k
Merge medio
2g 10h
PR unite (30g)
342

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di systemd/systemd

Tutte le issue di systemd/systemd

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.