Re: Initiate command in another shell session?

Liste des GroupesRevenir à cu shell 
Sujet : Re: Initiate command in another shell session?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shell
Date : 14. Mar 2025, 00:41:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250313162146.570@kylheku.com>
References : 1 2
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-03-13, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
On some systems, opening a tty and calling ioctl(fd, TIOCSTI, ptr),
where ptr is a char*, will cause the single character *p to appear
as if it had been typed.

I used this in a Superuser Stackexchange answer, the C code from
which can be used as a sample.

https://superuser.com/questions/272818/how-to-turn-off-word-wrap-in-less/#1871997

What's such a thing doing on Superuser? It's part of trying to address
a usability quirk with the "less" pager, in a really hacky way.

I cobbed a solution together whereby we filter the to-be-paged text to
add a certain number of spaces to the start of every line, and then we
tell less to scroll to the right by exactly that many positions.

How we do that last step is by injecting the right arrow escape sequence
via TIOCSTI. (A small delay is required, so that this injection happens
after less has done its terminal initialization.)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
13 Mar 25 * Initiate command in another shell session?17Janis Papanagnou
13 Mar 25 +* Re: Initiate command in another shell session?6Dan Cross
13 Mar 25 i+- [OT] SunOS issue (historic) (was Re: Initiate command in another shell session?)1Janis Papanagnou
13 Mar 25 i`* Re: Initiate command in another shell session?4Janis Papanagnou
13 Mar 25 i `* Re: Initiate command in another shell session?3Dan Cross
14 Mar 25 i  +- Re: Initiate command in another shell session?1Janis Papanagnou
16 Mar 25 i  `- Re: Initiate command in another shell session?1Jim Diamond
13 Mar 25 +- Re: Initiate command in another shell session?1Kaz Kylheku
13 Mar 25 +- Re: Initiate command in another shell session?1David W. Hodgins
13 Mar 25 +- Re: Initiate command in another shell session?1Christian Weisgerber
14 Mar 25 +* Re: Initiate command in another shell session?6Keith Thompson
14 Mar 25 i+- Re: Initiate command in another shell session?1Kaz Kylheku
14 Mar 25 i+- Re: Initiate command in another shell session?1Dan Cross
14 Mar 25 i`* Re: Initiate command in another shell session?3Christian Weisgerber
14 Mar 25 i `* Re: Initiate command in another shell session?2Kaz Kylheku
15 Mar 25 i  `- Re: Initiate command in another shell session?1Christian Weisgerber
14 Mar 25 `- Re: Initiate command in another shell session?1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal