Skip to content

fix: don't cancel a guided install when the terminal can't be read - #93

Merged
spydisec merged 1 commit into
mainfrom
fix/guided-terminal-read
Nov 12, 2026
Merged

spydisec merged 1 commit into
mainfrom
fix/guided-terminal-read

Conversation

@spydisec

Copy link
Copy Markdown
Owner

Summary: on Ubuntu 25.10, curl ... | sudo sh printed the first question and cancelled before the user could type. A failed terminal read is now a clear refusal, and the docs give a command form that works on every system.

Cause

Ubuntu 25.10 ships sudo-rs in place of the classic sudo. It keeps the keyboard from a script that is piped into it, so the read from /dev/tty fails at once. install.sh took the failed read as an empty answer, and the empty answer as "no".

Fix

  • install.sh: a failed read prints refuse=terminal_read and exits 1. Nothing has changed at that point, because all questions come before the backup.
  • get.sh: on that refusal it prints the form that works.
  • README and get.sh header: the install command is now sudo sh -c "$(curl -fsSL <url>/get.sh)". The piped form stays for scripts that pass --yes, which asks nothing.

Tested

Guided install through a real terminal in containers, with --skip-load, both command forms:

System sudo Piped into sudo sudo sh -c
Ubuntu 25.10 sudo-rs 0.2.8 refuses with the hint (cancelled before the fix) installs
Ubuntu 25.04 1.9.16 installs installs
Debian 13 1.9.16 installs installs
Fedora 42 1.9.17 installs installs
AlmaLinux 9 1.9.17 installs installs
Amazon Linux 2023 1.9.15 installs installs
openSUSE Leap 15.6 1.9.15 installs installs
Arch 1.9.17 installs installs

Each untested system printed the untested_os warning and went ahead, as designed.

Not covered by an automated test: the guided questions need a terminal, which bats and the CI container job don't have.

On Ubuntu 25.10, "curl ... | sudo sh" printed the first question and
cancelled at once. Ubuntu 25.10 ships sudo-rs, which keeps the keyboard from a
script that is piped in, so the read from /dev/tty failed. install.sh took the
failed read as an empty answer, and the empty answer as "no".

- A failed read is now a refusal, refuse=terminal_read, with nothing changed.
  get.sh then prints the command form that works.
- The README and the get.sh header give that form first:
  sudo sh -c "$(curl -fsSL <url>/get.sh)". The piped form stays for scripts
  that pass --yes.

Tested through a terminal in containers. On Ubuntu 25.10 the piped form
refuses with the hint, and the sh -c form installs. Ubuntu 25.04, Debian 13,
Fedora 42, AlmaLinux 9, Amazon Linux 2023, openSUSE Leap 15.6 and Arch install
with both forms.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a430c60d-c02b-44fb-b217-dc258c4ec295
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@spydisec
spydisec merged commit 9818b78 into main Nov 12, 2026
30 checks passed
@spydisec
spydisec deleted the fix/guided-terminal-read branch November 12, 2026 00:19
spydisec added a commit that referenced this pull request Nov 12, 2026
Summary: on Ubuntu 26.04, `curl ... | sudo sh` hung at the first
question. It now refuses with the same hint as on Ubuntu 25.10.

## Cause

#93 made a failed terminal read a refusal. That covers sudo-rs 0.2.8 on
Ubuntu 25.10, where the read fails. Under sudo-rs 0.2.13 on Ubuntu 26.04
the read doesn't fail. The piped script runs in the background of the
terminal, so the kernel stops it when it reads the keyboard, and it
stays stopped.

## Fix

`install.sh` ignores that stop signal (`TTIN`) when `sudo -V` says
sudo-rs. The read then fails, and install refuses with `terminal_read`
and the hint.

The classic sudo moves a stopped script to the foreground, so the piped
form works there. A first version ignored the signal everywhere, and
that broke the piped form on Ubuntu 24.04, so the signal is left alone
unless sudo is sudo-rs.

## Tested

Guided install through a real terminal in containers, with
`--skip-load`:

| System | sudo | Piped into sudo | `sudo sh -c` |
|---|---|---|---|
| Ubuntu 26.04 | sudo-rs 0.2.13 | refuses with the hint (hung before) |
installs |
| Ubuntu 25.10 | sudo-rs 0.2.8 | refuses with the hint | installs |
| Ubuntu 24.04 | 1.9.15 | installs | installs |
| Debian 13 | 1.9.16 | installs | installs |
| AlmaLinux 9 | 1.9.17 | installs | installs |

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant