Discussion:
GNU screen
(too old to reply)
Ben Collver
2023-11-01 16:44:51 UTC
Permalink
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
2023-11-03 16:30:55 UTC
Permalink
... This is Slackware's fault, because GNU screen instructs packagers
to update their termcap and terminfo.
# 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.
Henrik Carlqvist
2023-11-04 10:01:54 UTC
Permalink
Post by Rich
... This is Slackware's fault, because GNU screen instructs packagers
to update their termcap and terminfo.
# 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.
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
2023-11-04 16:06:47 UTC
Permalink
Post by Henrik Carlqvist
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.
Petri Kaukasoina
2023-11-04 10:00:45 UTC
Permalink
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.
# 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: ***@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.
Ben Collver
2023-11-04 16:04:13 UTC
Permalink
Post by Petri Kaukasoina
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
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
Dan C
2023-11-15 14:39:33 UTC
Permalink
Post by Ben Collver
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.
# 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
Post by Ben Collver
/dev/null 2>&1
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: Loading Image...
Bozo User
2024-01-20 23:57:10 UTC
Permalink
Post by Dan C
Post by Ben Collver
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.
# 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
Post by Ben Collver
/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

Loading...