[SOLVED] 14.2: less displays last viewed file above current file on all hosts.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
14.2: less displays last viewed file above current file on all hosts.
There are 4 hosts here running 14.2. Two are 32-bit, two are 64-bit. One of each flavor is an upgrade from 14.1, one of each flavor is a new install. The virtual terminal is urxvt. In all of them when I view a file with 'less' I see the tail end of the file previously viewed with less in that virtual terminal.
I seek ideas on how to fix this or, at least, diagnose why it's happening. Has not before been an issue with Slackware-8.0 through 14.1 on both 32- and 64-bit installations.
There are 4 hosts here running 14.2. Two are 32-bit, two are 64-bit. One of each flavor is an upgrade from 14.1, one of each flavor is a new install. The virtual terminal is urxvt. In all of them when I view a file with 'less' I see the tail end of the file previously viewed with less in that virtual terminal.
I seek ideas on how to fix this or, at least, diagnose why it's happening. Has not before been an issue with Slackware-8.0 through 14.1 on both 32- and 64-bit installations.
It could be a shell setting you have in ~/.bashrc. Try temporarily moving this file somewhere else and log in without your own bashrc to see if it still happens. I had a shopt setting some time ago which messed up my terminal.
I tried moving ~/.bashrc out of the way, then ~/.bash_profile, and neither made a difference. 'less' still displays the end of the previously viewed file on top of the current one.
I'm open to all suggestions of what to try (or examine) to figure out the cause of this behavior.
Perhaps try adding an entry to /etc/termcap for rxvt-unicode.
There is a rxvt-unicode stanza in /etc/termcap; what it means I don't know:
rxvt-unicode|rxvt-unicode terminal (X Window System):\
:am:bw:eo:km:mi:ms:xn:xo:\
:co#80:it#8:li#24:lm#0:\
:AL=\E[%dLC=\E[%dPL=\E[%dMO=\E[%dB:IC=\E[%d@:\
:K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=\E(B:al=\E[L:\
:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
:dl=\E[M:do=^J:ec=\E[%dX:ei=\E[4l:ho=\E[H:\
:i1=\E[?47l\E=\E[?1l:ic=\E[@:im=\E[4h:\
:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:kD=\E[3~:\
:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l\E>:\
:kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:\
:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:\
:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
:te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:up=\E[A:\
:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\
:vs=\E[?25h:
You have not used code tags to enclose the contents of the termcap stanza, but it appears to differ from what I see as the output of 'infocmp -Cr rxvt-unicode-256color'.
Interesting. Does this mean termcap applications like less and screen don't behave properly if there's no termcap entry, even if there are terminfo entries?
You have not used code tags to enclose the contents of the termcap stanza, but it appears to differ from what I see as the output of 'infocmp -Cr rxvt-unicode-256color'.
I've done nothing to the termcap file; what I posted is what is in there.
There are three termcap files in /etc/:
$ ll termcap*
-rw-r--r-- 1 root root 12389 Dec 14 2011 termcap
-rw-r--r-- 1 root root 706385 Mar 2 2000 termcap-BSD
-rw-r--r-- 1 root root 8969 Feb 15 2004 termcap-Linux
These are what are provided by Slackware. If the -BSD and -Linux are too ancient, I can remove them; as far as I know only the 2011 version is used by the system.
I've done nothing to the termcap file; what I posted is what is in there.
There are three termcap files in /etc/:
$ ll termcap*
-rw-r--r-- 1 root root 12389 Dec 14 2011 termcap
-rw-r--r-- 1 root root 706385 Mar 2 2000 termcap-BSD
-rw-r--r-- 1 root root 8969 Feb 15 2004 termcap-Linux
These are what are provided by Slackware. If the -BSD and -Linux are too ancient, I can remove them; as far as I know only the 2011 version is used by the system.
How sure are you about that?
On an unmodified 14.2 system you should have this:
jet$ ls -l termcap*
-rw-r--r-- 1 root root 8969 Feb 16 2004 termcap
-rw-r--r-- 1 root root 706385 Mar 2 2000 termcap-BSD
-rw-r--r-- 1 root root 8969 Feb 16 2004 termcap-Linux
If this is an upgraded system, please note that 14.2's upgrade script will not have replaced or modified your termcap file if you already had it (see shortly before the end of /var/log/scripts/etc-14.2-x86_64-7)
So.... where were you, and what were you doing on the 14th of December 2011?
And, what are the first two lines of /etc/termcap on your system?
And if they are as follows:
Code:
# [Slackware note: If you're looking for a big, full-featured termcap,
# use /etc/termcap-BSD instead ]
what do you see when you do 'diff /etc/termcap-Linux /etc/termcap' ?
As a five minute experiment, it would be worth copying your /etc/termcap somewhere safe, and then copying /etc/termcap-Linux to /etc/termcap, and then rebooting, and then seeing if your problem goes away.
I've found a way to fix the issue; it's more of a kludge than identifying the cause of the behavior change with 14.2. In ~/.bash_profile I've added the line export LESS="-c". Got the idea from closely reading the man page and it's working for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.