• Bug#1099825: `dpkg -l doesnotexist` runs pager with empty contents, wit

    From Josh Triplett@1:229/2 to All on Sat Mar 8 16:40:01 2025
    XPost: linux.debian.bugs.dist
    From: josh@joshtriplett.org

    Package: dpkg
    Version: 1.22.17
    Severity: normal
    X-Debbugs-Cc: josh@joshtriplett.org

    If you run `dpkg -l doesnotexist`, it launches a pager showing
    completely empty output, while printing the error
    `dpkg-query: no packages found matching doesnotexist`
    outside of the pager, hidden until exiting the pager.

    `dpkg -l dpkg doesnotexist` will show the output for `dpkg` in the
    pager, while showing the error for `doesnotexist` outside the pager.
    That's slightly less of an issue because the pager screen isn't
    completely blank, but it still doesn't seem ideal.

    In the case where there's *zero* output, I think dpkg shouldn't be
    launching the pager at all.

    In the case where there's *some* output, ideally I'd love to have the
    error output sent to the pager as well when automatically launching a
    pager, if stdout and stderr are both pointing to a terminal, and only
    kept separate when *not* launching a pager or if stderr is going
    somewhere else.

    -- System Information:
    Debian Release: trixie/sid
    APT prefers unstable
    APT policy: (500, 'unstable'), (1, 'experimental')
    Architecture: amd64 (x86_64)
    Foreign Architectures: arm64

    Kernel: Linux 6.12.17-amd64 (SMP w/12 CPU threads; PREEMPT)
    Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)

    Versions of packages dpkg depends on:
    ii libbz2-1.0 1.0.8-6
    ii libc6 2.41-3
    ii liblzma5 5.6.4-1
    ii libmd0 1.1.0-2+b1
    ii libselinux1 3.8-4
    ii libzstd1 1.5.6+dfsg-2
    ii tar 1.35+dfsg-3.1
    ii zlib1g 1:1.3.dfsg+really1.3.1-1+b1

    dpkg recommends no packages.

    Versions of packages dpkg suggests:
    ii apt 2.9.31
    pn debsig-verify <none>

    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)