• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 23825567702
72%

Build:
DEFAULT BRANCH: main
Ran 01 Apr 2026 02:59AM UTC
Jobs 1
Files 2018
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Mar 2026 12:42PM UTC coverage: 72.404% (+0.006%) from 72.398%
23825567702

push

github

daandemeyer
terminal-util: fix boot hang from ANSI terminal size queries

Since v257, terminal_fix_size() is called during early boot via
console_setup() → reset_dev_console_fd() to query terminal dimensions
via ANSI escape sequences. This has caused intermittent boot hangs
where the system gets stuck with a blinking cursor and requires a
keypress to continue (see systemd/systemd#35499).

The function tries CSI 18 first, then falls back to DSR if that fails.
Previously, each method independently opened a non-blocking fd, disabled
echo/icanon, ran its query, restored termios, and closed its fd. This
created two problems:

1. Echo window between CSI 18 and DSR fallback: After CSI 18 times out
   and restores termios (re-enabling ECHO and ICANON), there is a brief
   window before DSR disables them again. If the terminal's CSI 18
   response arrives during this window, it is echoed back to the
   terminal — where the terminal interprets \e[8;rows;cols t as a
   "resize text area" command — and the response bytes land in the
   canonical line buffer as stale input that can confuse the DSR
   response parser.

2. Cursor left at bottom-right on DSR timeout: The DSR method worked by
   sending two DSR queries — one to save the cursor position, then
   moving the cursor to (32766,32766) and sending another to read the
   clamped position. If neither response was received (timeout), the
   cursor restore was skipped (conditional on saved_row > 0), leaving
   the cursor at the bottom-right corner of the terminal. The
   subsequent terminal_reset_ansi_seq() then moved it to the beginning
   of the last line via \e[1G, making boot output appear at the bottom
   of the screen — giving the appearance of a hang even when the system
   was still booting.

This commit fixes both issues:

- terminal_fix_size() now opens the non-blocking fd and configures
  termios once for both query methods, so echo stays disabled for the
  entire CSI 18 → DSR fallback sequence with no gap. tcflu... (continued)

22 of 57 new or added lines in 3 files covered. (38.6%)

834 existing lines in 52 files now uncovered.

318485 of 439872 relevant lines covered (72.4%)

1162379.76 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
35
42.14
1.74% src/basic/terminal-util.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
81.25
-0.52% src/basic/efivars.c
1
97.64
-0.1% src/basic/hashmap.c
1
54.65
-0.09% src/home/homed-manager.c
1
82.37
-0.32% src/journal/journalctl-show.c
1
73.91
-4.35% src/libsystemd-network/lldp-network.c
1
80.43
-0.36% src/libsystemd-network/sd-ndisc.c
1
77.5
-0.63% src/libsystemd/sd-id128/id128-util.c
1
92.26
0.0% src/libsystemd/sd-journal/journal-file.c
1
72.0
-0.57% src/login/logind-varlink.c
1
83.83
-0.12% src/network/networkd-dhcp-prefix-delegation.c
1
87.39
-0.23% src/network/tc/qdisc.c
1
43.8
-0.26% src/resolve/resolved-mdns.c
1
94.92
-0.07% src/shared/dns-rr.c
1
94.09
-0.1% src/test/test-time-util.c
2
89.8
-0.37% src/basic/compress.c
2
82.77
-0.19% src/basic/process-util.c
2
69.65
0.0% src/core/exec-invoke.c
2
82.67
-0.38% src/core/path.c
2
91.36
0.0% src/id128/id128.c
2
84.05
-0.23% src/libsystemd-network/sd-dhcp-server.c
2
80.59
-0.54% src/libsystemd/sd-bus/bus-convenience.c
2
94.85
-2.06% src/libsystemd/sd-bus/test-bus-peersockaddr.c
3
79.85
-0.18% src/core/execute.c
3
58.15
-0.19% src/core/main.c
3
81.57
-0.12% src/core/manager.c
3
73.88
-0.25% src/core/mount.c
3
46.08
-0.2% src/imds/imdsd.c
3
64.84
-0.41% src/libsystemd/sd-journal/journal-verify.c
3
79.2
-0.25% src/resolve/resolved-manager.c
3
79.51
-0.82% src/shared/bus-polkit.c
4
75.17
-0.67% src/core/transaction.c
4
78.11
-1.13% src/journal-remote/journal-upload-journal.c
4
40.52
-0.19% src/login/logind-dbus.c
4
81.77
-0.99% src/network/networkd-sysctl.c
5
81.64
-0.09% src/libsystemd/sd-varlink/sd-varlink.c
7
84.83
-0.25% src/network/networkd-link.c
8
80.67
-0.23% src/core/unit.c
8
82.87
-0.36% src/resolve/resolved-link.c
9
63.55
-1.68% src/shared/loop-util.c
10
85.71
-0.31% src/shared/verbs.c
11
57.93
-1.84% src/timesync/timesyncd-manager.c
11
79.33
-5.29% src/udev/udevadm-wait.c
12
70.35
-1.4% src/resolve/resolved-dns-scope.c
14
90.85
0.85% src/shared/options.c
21
86.03
-0.53% src/test/test-terminal-util.c
22
66.78
-0.69% src/core/service.c
32
62.01
-1.66% src/core/socket.c
33
51.14
-2.35% src/detect-virt/detect-virt.c
35
90.94
0.1% src/shared/format-table.c
54
55.47
-1.06% src/hostname/hostnamectl.c
82
18.09
0.57% src/factory-reset/factory-reset-tool.c
390
42.14
1.74% src/basic/terminal-util.c
Jobs
ID Job ID Ran Files Coverage
1 23825567702.1 01 Apr 2026 02:59AM UTC 2018
72.4
GitHub Action Run
Source Files on build 23825567702
  • Tree
  • List 2018
  • Changed 88
  • Source Changed 22
  • Coverage Changed 79
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23825567702
  • da698487 on github
  • Prev Build on main (#23774132158)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc