Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNU screen

47 views
Skip to first unread message

Ben Collver

unread,
Nov 1, 2023, 12:44:55 PM11/1/23
to
Screen sets the TERMCAP environment variable for old termcap programs.
Elvis is one such program. Slackware relies on the TERMCAP
variable, which is present in a local terminal, but not over
SSH to another Slackware system. At that point, vi fails because
TERMCAP is empty. TERM is set to "screen" but has no matching entry
in /etc/termcap nor in terminfo. This is Slackware's fault, because
GNU screen instructs packagers to update their termcap and terminfo.

Below is a fix for doinst.sh:

# Copy this update into place, and install it from doinst.sh
mkdir -p $PKG/etc/termcap.d
cp terminfo/screencap $PKG/etc/termcap.d/
cp terminfo/screeninfo.src $PKG/usr/share/screen/

# install screen termcap and terminfo entries
cat /etc/termcap-Linux /etc/termcap.d/* >/etc/termcap
tic /usr/share/screen/screeninfo.src >/dev/null 2>&1

Rich

unread,
Nov 3, 2023, 12:30:58 PM11/3/23
to
Ben Collver <benco...@tilde.pink> wrote:
> ... This is Slackware's fault, because GNU screen instructs packagers
> to update their termcap and terminfo.
>
> Below is a fix for doinst.sh:
>
> # Copy this update into place, and install it from doinst.sh
> mkdir -p $PKG/etc/termcap.d
> cp terminfo/screencap $PKG/etc/termcap.d/
> cp terminfo/screeninfo.src $PKG/usr/share/screen/
>
> # install screen termcap and terminfo entries
> cat /etc/termcap-Linux /etc/termcap.d/* >/etc/termcap
> tic /usr/share/screen/screeninfo.src >/dev/null 2>&1

Given that GNU screen is provided by Slackware itself, and that it is
very unlikely that Pat is reading alt.os.linux.slackware, you should
report this to Slackware (Pat) instead of here on Usenet.

Petri Kaukasoina

unread,
Nov 4, 2023, 6:00:58 AM11/4/23
to
Ben Collver <benco...@tilde.pink> wrote:
>TERM is set to "screen" but has no matching entry in /etc/termcap nor in
>terminfo. This is Slackware's fault, because GNU screen instructs packagers
>to update their termcap and terminfo.
>
>Below is a fix for doinst.sh:
>
># Copy this update into place, and install it from doinst.sh
>mkdir -p $PKG/etc/termcap.d
>cp terminfo/screencap $PKG/etc/termcap.d/
>cp terminfo/screeninfo.src $PKG/usr/share/screen/
>
># install screen termcap and terminfo entries
>cat /etc/termcap-Linux /etc/termcap.d/* >/etc/termcap
>tic /usr/share/screen/screeninfo.src >/dev/null 2>&1

Which Slackware version you have? These days there is no file
/etc/termcap-Linux. In Slackware 15.0 "screen" is both in termcap and
terminfo. Both /etc/termcap and /usr/share/terminfo/s/screen come in package
ncurses-6.3-x86_64-1.

At least in Slackware-8.1 (year 2002) there already was "screen" in
terminfo. But then install.sh of etc-5.0-noarch-7.tgz copied a short termcap
from /etc/termcap-Linux (without "screen") to /etc/termcap while there was a
more complete alternative /etc/termcap-BSD (with "screen"). The first lines
of /etc/termcap-Linux in Slackware-8.1:

# [Slackware note: If you're looking for a big, full-featured termcap,
# use /etc/termcap-BSD instead ]
#
# From: miq...@drinkel.ow.org (Miquel van Smoorenburg)
#
# Okay guys, here is a shorter termcap that does have most
# capabilities and is ncurses compatible. If it works for you
# I'd like to hear about it.
#
# Some entries in termcap 2.0.7 are too long and your programs
# may complain "tgetent: warning: termcap entry too long". Here is
# a smaller termcap. But it may not cover as many terminals as the one
# in termcap 2.0.7. You can install it as /etc/termcap.

Henrik Carlqvist

unread,
Nov 4, 2023, 6:03:04 AM11/4/23
to
Also, if you reach out to Pat, it is more likely that he is going to fix
Slackware-current (which one day will become Slackware 15.1) than fixing
some old Slackware 14.* which will become EOL 1/1 2024.

I can't say for sure about slackware-current, but latest Slackware 15.0
does not have /etc/termcap-Linux or the /etc/termcap.d directory. But
maybe you created that directory only for the screen fix?

Slackware 14.2 does have the /etc/termcap-Linux file, but also lacks the /
etc/termcap.d directories.

As a standard Slackware package might be installed both on a live
installed Slackware system and from the installation media, you should be
aware that the doinst.sh script is being run from the / directory of the
target system, but that might differ from / of the running system which
during Slackware installation is a ram file system uncompressed from
isolinux/initrd.img. There is probably not much point in modifying /etc/
termcap on that ramdisk during initial installation.

The $PKG variable is usually not used by the doinst.sh during
installation, but by the Slackbuild script during package creation. Was
it your intention to modify the doinst.sh of the screen package which is
run during installation or was it your intention to modify the Slackbuild
script of screen? My guess is that the first part of the code was for
screen.Slackbuild but the second part was for doinst.sh of the screen
package?

Part of the problem here is that the file /etc/termcap is not part of the
screen package, which package it belongs to depends upon the Slackware
version. In Slackware 14.2 /etc/termcap comes from the etc package, but
in Slackware 15.0 it comes from the ncurses package. The etc package in
14.2 has a doinst.sh script which copies termcap-Linux to termcap if
termcap does not already exist. The doinst.sh in the ncureses package for
Slackware 15.0 has no such thing, it simply just contains a plain /etc/
termcap.

As /etc/termcap is not part of the screen package, maybe Pat would prefer
to apply the fix to the package where /etc/termcap belongs. Any
modifications of etc/termcap made by other packages would be lost if the
original package containing that file gets upgraded.

One forum which Pat occasionally reads is
https://www.linuxquestions.org/questions/slackware-14/
That forum has a long thread "Requests for current-next (15.0-->15.1)"
which might be a good place to ask for changes like this. However, it
might be an even better idea to start a thread of its own for this to get
help iron things out before proposing a final solution.

Whether or not you choose to try to reach out to Pat to get this fixed in
upcoming versions of Slackware, I think it was a good thing that you
posted your solution here. Search engines like google will help people
having trouble running Elvis in screen to find your solution.

regards Henrik

Ben Collver

unread,
Nov 4, 2023, 12:04:20 PM11/4/23
to
On 2023-11-04, Petri Kaukasoina <kaukasoina...@sci.fi> wrote:
> Which Slackware version you have? These days there is no file
> /etc/termcap-Linux. In Slackware 15.0 "screen" is both in termcap and
> terminfo. Both /etc/termcap and /usr/share/terminfo/s/screen come in package
> ncurses-6.3-x86_64-1.
>
> At least in Slackware-8.1 (year 2002) there already was "screen" in
> terminfo. But then install.sh of etc-5.0-noarch-7.tgz copied a short termcap
> from /etc/termcap-Linux (without "screen") to /etc/termcap while there was a
> more complete alternative /etc/termcap-BSD (with "screen"). The first lines
> of /etc/termcap-Linux in Slackware-8.1:

I wrote this note while using Slackware 14.x. Thanks for the in-depth
analysis. I do see the screen entry in /etc/termcap under Slackware
15.0. Looks like this has already been resolved. :-)

-Ben

Ben Collver

unread,
Nov 4, 2023, 12:06:51 PM11/4/23
to
On 2023-11-04, Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> Also, if you reach out to Pat, it is more likely that he is going to fix
> Slackware-current (which one day will become Slackware 15.1) than fixing
> some old Slackware 14.* which will become EOL 1/1 2024.

It looks like this is already resolved in Slackware 15.0. The answer
to all of your questions is yes. Good guessing! :-)

Thanks for your thoughtful reply.

Dan C

unread,
Nov 15, 2023, 9:39:37 AM11/15/23
to
Use tmux.


--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he lay back and lit Piglet's cigarette.
Usenet Improvement Project: http://twovoyagers.com/improve-usenet.org/
Thanks, Obama: http://brandybuck.site40.net/pics/politica/thanks.jpg

Bozo User

unread,
Jan 20, 2024, 6:57:13 PMJan 20
to
On 2023-11-15, Dan C <youmust...@lan.invalid> wrote:
> On Wed, 1 Nov 2023 16:44:51 -0000 (UTC), Ben Collver wrote:
>
>> Screen sets the TERMCAP environment variable for old termcap programs.
>> Elvis is one such program. Slackware relies on the TERMCAP variable,
>> which is present in a local terminal, but not over SSH to another
>> Slackware system. At that point, vi fails because TERMCAP is empty.
>> TERM is set to "screen" but has no matching entry in /etc/termcap nor in
>> terminfo. This is Slackware's fault, because GNU screen instructs
>> packagers to update their termcap and terminfo.
>>
>> Below is a fix for doinst.sh:
>>
>> # Copy this update into place, and install it from doinst.sh mkdir -p
>> $PKG/etc/termcap.d cp terminfo/screencap $PKG/etc/termcap.d/
>> cp terminfo/screeninfo.src $PKG/usr/share/screen/
>>
>> # install screen termcap and terminfo entries cat /etc/termcap-Linux
>> /etc/termcap.d/* >/etc/termcap tic /usr/share/screen/screeninfo.src
>> >/dev/null 2>&1
>
> Use tmux.
>
>

Or better, I'd switch elvis for nvi. It has Unicode support.
BUt, if I were Ben, I'd try vis(1)
with structural regular expressions, the same ones Sam uses
at Plan9/9front. Creating complex scopes and replacements
it's a breeze:

:x/term to search and delimit/ c/replace/

Tmux has a setting at ~/.tmux.conf to avoid lag
on pressing [ESC] and switching modes:

set -sg escape-time 10


0 new messages