|
|
Subscribe / Log in / New account

Automatic pager invocation

Automatic pager invocation

Posted Apr 17, 2025 0:46 UTC (Thu) by dskoll (subscriber, #1630)
In reply to: Automatic pager invocation by quotemstr
Parent article: What's new in APT 3.0

Yeah, I prefer manual control too, though something like apt ... whatever | cat should work too, because it probably only invokes the pager if standard output is a TTY.


to post comments

Automatic pager invocation

Posted Apr 17, 2025 6:49 UTC (Thu) by epa (subscriber, #39769) [Link] (1 responses)

There's a missing middle ground between a full tty (where you can use cursor movement commands) and sending output to a file. Another example is Emacs's shell-mode. If it didn't return true to isatty() then gzip might write binary data to stdout, and other programs wouldn't prompt interactively. So it has to claim to be a tty, but then some tools want to run a pager or do cursor movement.

There should be a similar function isinteractive() provided by the C library and kernel somehow. When you create a pty you can specify whether it should be a full terminal (returning true to both isatty() and isinteractive()) or just a kind of interactive thingy (isinteractive=true but isatty=false). I guess if any computer museums are using real printing terminals they could also benefit from this. You don't want to run less(1) on your Teletype, though I guess more(1) could work.

Automatic pager invocation

Posted Apr 17, 2025 7:23 UTC (Thu) by neilbrown (subscriber, #359) [Link]

$TERM goes some way in that direction


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds