On Wed, 20 Oct 2021 18:45:11 -0000 (UTC)
Eli the Bearded <*@
eli.users.panix.com> wrote:
> In comp.unix.shell, Spiros Bousbouras <
spi...@gmail.com> wrote:
> > Eli the Bearded <*@
eli.users.panix.com> wrote:
> > > 1. I want to capture stuff and have it saved to disk rapidly, so that
> > > output is not lost in the case of a power interruption. I want text
> > > capture for this.
> > The man page for script on my system says
> >
> > -f Flush output after each write. This is nice for
> > telecooperation: One person does `mkfifo foo; script -f foo'
> > and another can supervise real-time what is being done using
> > `cat foo'.
>
> mkfifo! Hahaha, the old tricks. But last time I did that I used the
> "mknod foo p" method.
>
> Which script is that?
Debian Linux. Your script doesn't have the -f option ?
> > I don't recall ever seeing any terminfo capabilities which are for querying
> > the terminal.
>
> The most commonly used ones are the u[6789] sequenences.
>
> man resize
> ...
>
> • then resize asks the terminal for its size in characters.
> Depending on whether the "-s option is given, resize uses a
> different escape sequence to ask for this information.
>
> The resize command sends an cursor position request to go to 999,999
> then a cursor enquiry (u6) to get the response from the terminal (u8).
> Reading that response, it knows how big the terminal screen is.
>
>
https://dickey.his.com/ncurses/terminfo.src.html
I had some trouble finding on the page the relevant part. It's
# INTERPRETATION OF USER CAPABILITIES
#
# The System V Release 4 and XPG4 terminfo format defines ten string
# capabilities for use by applications, <u0>...<u9>. In this file, we use
# certain of these capabilities to describe functions which are not covered
# by terminfo. The mapping is as follows:
#
# u9 terminal enquire string (equiv. to ANSI/ECMA-48 DA)
# u8 terminal answerback description
# u7 cursor position request (equiv. to VT100/ANSI/ECMA-48 DSR 6)
# u6 cursor position report (equiv. to ANSI/ECMA-48 CPR)
.Note that it actually says that the specific interpretations are not part
of terminfo. man 5 terminfo gives
user0 u0 u0 User string #0
user1 u1 u1 User string #1
user2 u2 u2 User string #2
user3 u3 u3 User string #3
user4 u4 u4 User string #4
user5 u5 u5 User string #5
user6 u6 u6 User string #6
user7 u7 u7 User string #7
user8 u8 u8 User string #8
user9 u9 u9 User string #9
I didn't read the
dickey.his.com page carefully enough to see what he
means by "In this file, we use" .I'm guessing it's some kind of notational
extension specific to the page/file and not part of "standard" terminfo
notation.
[...]
> Elijah
> ------
> remembers when `eval resize` was a useful addition to .profile
I take it that was before the time usual shells automatically set the
COLUMNS and LINES variables. I have in my shell environment the function
dims () { printf 'Lines : %d Columns : %d\n' `tput lines` `tput cols` ; }
That's another method which works.
--
The delight of working in a medium so tractable - pure thought-stuff - which
nevertheless exists, moves, and works in a way that word-objects do not.
"The mythical man-month" by Frederick Brooks