Skip to content

arch-updater: fix flatpak update always declining in terminal mode - #507

Open
sandrigo wants to merge 2 commits into
noctalia-dev:mainfrom
sandrigo:fix/arch-updater-flatpak-terminal-prompt
Open

arch-updater: fix flatpak update always declining in terminal mode#507
sandrigo wants to merge 2 commits into
noctalia-dev:mainfrom
sandrigo:fix/arch-updater-flatpak-terminal-prompt

Conversation

@sandrigo

@sandrigo sandrigo commented Aug 28, 2026

Copy link
Copy Markdown

Plugin

  • Id: yuuto/arch-updater
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Fixes an issue where Update in terminal mode always fails on the Flatpak step: it auto-declines its own [Y/n] confirmation with "n" and exits 1, no matter what is typed. pacman/AUR prompts in the same run are unaffected.

External dependencies

None new. The Flatpak leg still shells out to the same flatpak update already listed in dependencies in plugin.toml, just with different flags.

Testing

Reproduced on my own machine (CachyOS, Niri, arch-updater 2.0.1, update_mode = terminal, flatpak_enabled = true): triggered Update from the bar widget with pending pacman/AUR and Flatpak updates. pacman/AUR update applied normally with interactive prompts; the Flatpak update prompt appeared, then auto-answered "n" on its own, and the run ended with ::EXIT 1.

Applied this fix locally against the installed plugin and re-ran Update the same way: pacman/AUR stayed fully interactive (PKGBUILD review, conflict prompts, etc. untouched), the Flatpak updates applied without any prompt, and the run completed with ::EXIT 0.

Root cause: buildTerminalCommand() pipes the whole run's output into tee for the log ({ ...; } 2>&1 | tee -a $log). flatpak's own Y/n confirmation gates on isatty(stdout), so once stdout is a pipe into tee it always treats itself as non-interactive and auto-answers "n" — a known flatpak behavior, see flatpak/flatpak#4409. pacman and the AUR helpers don't gate their prompts on stdout being a tty, so they're unaffected by the same tee. Since real interactivity for the Flatpak step isn't achievable here, this passes -y --noninteractive to it in terminal mode too, matching what buildBackgroundCommand() already does.

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: v5.0.0 (5.0.0_beta.9-3)
  • Plugin API level: 9

Screenshots / Videos

No visual/UI surface changes — this only changes the flags passed to an existing shell command; the panel and widget are unchanged.

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

buildTerminalCommand() pipes the whole update run's output into `tee`
for the log. flatpak's Y/n confirmation gates on isatty(stdout), so
under `tee` it always sees a non-tty stdout, treats itself as
non-interactive, and auto-answers "n" no matter what the user types -
this is a known flatpak behavior (flatpak/flatpak#4409). pacman and
the AUR helpers don't have this restriction, so their prompts keep
working fine in the same pipeline; only flatpak's leg silently fails
with exit 1.

Since real interactivity for the flatpak step can't work here anyway,
pass -y --noninteractive to it in terminal mode too, matching what
background mode already does. pacman/AUR review stays fully
interactive.
@github-actions

Copy link
Copy Markdown
Contributor

CC @Reiling-Jeff

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.

2 participants