Skip to content

Show plugin update diffs without git's pager - #12335

Closed
elberacasa wants to merge 1 commit into
omacom:quattrofrom
elberacasa:plugin-update-no-pager
Closed

elberacasa wants to merge 1 commit into
omacom:quattrofrom
elberacasa:plugin-update-no-pager

Conversation

@elberacasa

Copy link
Copy Markdown

omarchy plugin update <id> prints the diff with an unpiped git diff, so git starts its pager whenever output goes to a terminal. The gum confirm "Update <id>?" that follows then waits behind the pager, invisible: Enter scrolls one line inside less, so the update looks stuck with nothing to suggest a keypress is expected. Quitting the pager with q reveals the prompt.

Only installs without delta are affected. On the delta path the diff is piped, which makes git skip its pager, so the prompt is already visible there; --no-pager gives the other path the same behaviour.

Verification

Omarchy 4.0.4-1, gum 2.0.0-1, delta not installed, default core.pager.

With a throwaway plugin whose upstream is one commit ahead, run in a real terminal with GIT_PAGER set to announce itself:

Result
Before git started a pager; the confirmation never appeared
After no pager; the diff printed straight to the terminal and the confirmation followed

test/cli passes, and shellcheck is clean on the changed file.

Notes

bin/omarchy-plugin-add prints no diff, and the other git log calls in bin/ run inside command substitution, where git never pages, so this is the only place affected.

Reported as #12332, which this replaces.

@Lifferado

Copy link
Copy Markdown

Independent reproduction, on a newer build than the one in #12332.

System: omarchy-dev 4.0.0.r2186.gee8ebf6 on the edge channel (built 4 days after #12332 was closed), git-delta not installed, PAGER/LESS/core.pager all unset.

Hit this during a normal omarchy update, not a manual omarchy plugin update — a post-update.d hook calls omarchy-plugin-update <id>, so the pager opens in the middle of an otherwise hands-off update. The run ends at a bare : with no indication a pager is waiting, which reads as a failed or hung update rather than a prompt. The transcript omarchy-update writes via script to /tmp/omarchy-update.log confirms it — cat -v shows the tail is less's init and prompt, with no error and no ERR trap:

...
Changes for <plugin>:^M
^[[?1h^[=^M^[[1mdiff --git a/CHANGELOG.md b/CHANGELOG.md^[[m
...
:^[[K

Worth noting for prioritisation: git-delta is not a dependency of the omarchy package, nor an optional one — git is. So the unpatched else branch is the default path, not the edge case.

There is also a second-order effect the original issue didn't cover. omarchy-update holds a root systemd-inhibit --what=sleep:idle --mode=block for the duration. If the terminal is closed while parked at the pager, that inhibitor is left behind — observed here as a live systemd-inhibit owned by root with the parent script gone, plus ~/.local/state/omarchy/indicators/stay-awake still set. The machine then won't suspend or idle-lock, which on a laptop silently defeats lid-close suspend, and the cause is several steps removed from the update that looked like it merely failed. omarchy-update-stay-awake stop clears it. That makes the pager stall more than cosmetic.

This patch is the fix. Applying the equivalent locally (GIT_PAGER=cat in front of the hook) resolved it, and installing git-delta to take the other branch also resolves it — both confirm the diagnosis.

One process note: #12332 was closed as completed in favour of this PR, so the bug currently has no open tracking issue while the patch sits unmerged. Anyone hitting it and searching will find a closed issue and conclude it is fixed.

@elberacasa

Copy link
Copy Markdown
Author

Thank you, that is a better report than the one I filed.

Confirmed the dependency point here on 4.0.4-1: git is in the omarchy package's depends and git-delta is in neither depends nor optdepends, so the paging branch is what a default install takes.

The inhibitor part is the one that changes how this reads. My issue treated it as a confusing prompt; parking a hands-off omarchy update at a pager while a root systemd-inhibit is held, and leaving that inhibitor behind if the terminal is closed, is a laptop that quietly stops suspending, several steps removed from anything that looked wrong.

On the process note: you are right, and I reopened #12332 so the bug has an open tracking issue while the patch waits. It closes when this merges.

The patch is unchanged and still one word on the non-delta branch, matching what the delta branch already does.

@elberacasa elberacasa closed this by deleting the head repository Sep 26, 2026
@elberacasa

Copy link
Copy Markdown
Author

Reopened as #13345. This one closed because I deleted my fork by accident, not because anything was wrong with the patch. Same change, rebased on current quattro, and your reproduction is carried over into the description. Sorry for the churn, @Lifferado.

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