Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help: Terminal lacks ability to clear the screen or position
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 6:18 pm    Post subject: Help: Terminal lacks ability to clear the screen or position Reply with quote

:x

Help please. I recently did a BUNCH of emerging. I don't remember anymore all the programs I emerged (world). After I did this, I cannot use "nano -w file". I get the following error:

"Your terminal lacks the ability to clear the screen or position"

I have no idea what happened. It worked fine before I did the emerges. Just to go over what I did to correct this:
remerged nano & ncurses but it didn't help

Any help would be greatly appreciated. Thank you in advance.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 6:32 pm    Post subject: Re: Help: Terminal lacks ability to clear the screen or posi Reply with quote

Gigantopithicus wrote:
:x

Help please. I recently did a BUNCH of emerging. I don't remember anymore all the programs I emerged (world). After I did this, I cannot use "nano -w file". I get the following error:

"Your terminal lacks the ability to clear the screen or position"

I have no idea what happened. It worked fine before I did the emerges. Just to go over what I did to correct this:
remerged nano & ncurses but it didn't help

Any help would be greatly appreciated. Thank you in advance.


One thing that would have been nice is to know which terminal application you are using. Is it Konsole from KDE, xterm, eterm, or another program.

And also inlcude the output of 'env' so we can see what environment variables you have set.

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 7:39 pm    Post subject: Reply with quote

Ok. I'm using windows SSH client called PuTTy to login (as root). Terminal type string is xterm for PuTTy. Environment output is as follows:

Code:
PWD=/root
XINITRC=/etc/X11/xinit/xinitrc
PAGER=/usr/bin/less
HOSTNAME=utserver.dsli.com
KDEDIRS=/usr/kde/3:/usr
QTDIR=/usr/qt/3
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11R6/man
LESSOPEN=|lesspipe.sh %s
PS1=\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]
KDEDIR=/usr/kde/3
USER=root
LS_COLORS=
MAIL=/var/mail/root
QMAKESPEC=linux-g++
CVS_RSH=ssh
INPUTRC=/etc/inputrc
EDITOR=/usr/bin/nano
CONFIG_PROTECT_MASK=/etc/gconf
SSH_CLIENT=66.XXX.XXX.XXX 1361 22
LOGNAME=root
SHLVL=1
MOZILLA_FIVE_HOME=/usr/lib/mozilla
INFODIR=/usr/share/info:/usr/X11R6/info
SHELL=/bin/bash
HOME=/root
TERM=xterm-new
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/X11R6/bin:/usr/qt/3/bin:/usr/qt/2/bin: /usr/kde/3/bin:/usr/kde/2/bin
SSH_TTY=/dev/pts/3
SANE_CONFIG_DIR=/etc/sane.d
_=/usr/bin/env


Note that the same error occurs when I am in X with KDE session using Eterm.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 7:44 pm    Post subject: Reply with quote

Gigantopithicus wrote:

TERM=xterm-new

Note that the same error occurs when I am in X with KDE session using Eterm.


I would say, change the TERM variable to just contain xterm. This should take care of your problem as there are no definitions for type 'xterm-new'. That is what's causing your problem.

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 7:59 pm    Post subject: Reply with quote

Actually, that is not true. I've been trying other xterm types. Neither one (xterm or xterm-new) works. It just was that when I did env, I had used xterm-new, thats all.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue Sep 03, 2002 8:08 pm    Post subject: Reply with quote

or set it to "vt100"


ebrostig wrote:
Gigantopithicus wrote:

TERM=xterm-new

Note that the same error occurs when I am in X with KDE session using Eterm.


I would say, change the TERM variable to just contain xterm. This should take care of your problem as there are no definitions for type 'xterm-new'. That is what's causing your problem.

Erik
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 8:25 pm    Post subject: Reply with quote

Gigantopithicus wrote:
Actually, that is not true. I've been trying other xterm types. Neither one (xterm or xterm-new) works. It just was that when I did env, I had used xterm-new, thats all.

That is very weired. I use TERM=xterm without any problems.

Ok, let's do some troubleshooting:
cd /usr/lib/terminfo/x
ls -ld xterm
should show:
lrwxrwxrwx 1 root root 11 Jul 24 15:45 xterm -> xterm-color
which again is:
lrwxrwxrwx 1 root root 11 Jul 24 15:46 xterm-color -> ../n/nxterm
which again is:
-rw-r--r-- 1 root root 1415 Jun 27 04:25 nxterm

Make sure all of those links works and that the permissions and size of the nxterm is the same.

If you have a different size nxterm, it would be interesting to see it's contents.

You could also try to run your program that complains, under strace to see what the program is doing:
strace -f -o outputfile programname

Then check the outputfile to see how your program is trying to resolve the TERM variable and to read in the capabilities from the file.

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 8:27 pm    Post subject: Reply with quote

Tried vt100. Same prob. I really appreciate you all for trying to help. I'm beginning to wonder if my emerge of baselayout messed things up. I noticed that it changed /etc/inputrc among other config files.

Baselayout is version 1.8.2. I may try to remerge v1.7.9-r1 of baselayout and see if that does the trick.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 8:29 pm    Post subject: Reply with quote

Gigantopithicus wrote:
Tried vt100. Same prob. I really appreciate you all for trying to help. I'm beginning to wonder if my emerge of baselayout messed things up. I noticed that it changed /etc/inputrc among other config files.

Baselayout is version 1.8.2. I may try to remerge v1.7.9-r1 of baselayout and see if that does the trick.


I'm running baselayout 1.8.2 myself without any problems.

Also, check my previous posts for some pointers.

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 8:34 pm    Post subject: Reply with quote

Gotta emerge strace for program output. But here are my sym links:

Code:
lrwxrwxrwx    1 root     root           11 Sep  2 09:38 xterm -> xterm-color
lrwxrwxrwx    1 root     root           11 Sep  2 09:38 xterm-color -> ../n/nxterm
-rw-r--r--    1 root     root         1415 Sep  2 09:37 ../n/nxterm


I'll post strace output in a few.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 8:36 pm    Post subject: Reply with quote

Gigantopithicus wrote:
Gotta emerge strace for program output. But here are my sym links:

Code:
lrwxrwxrwx    1 root     root           11 Sep  2 09:38 xterm -> xterm-color
lrwxrwxrwx    1 root     root           11 Sep  2 09:38 xterm-color -> ../n/nxterm
-rw-r--r--    1 root     root         1415 Sep  2 09:37 ../n/nxterm


I'll post strace output in a few.

Those look identical to mine. nxterm is the same size as mine too.
Yes, I would love to see the strace output.

And just post the last, let's say 20-30 lines of the tracefile, not the whole!
Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 8:42 pm    Post subject: Reply with quote

strace -f -o output.txt nano -w hd.txt

Here's the last 23 lines of output:

Code:
4535  close(3)                          = 0
4535  munmap(0x40017000, 63673)         = 0
4535  brk(0)                            = 0x8060d7c
4535  brk(0x8060da4)                    = 0x8060da4
4535  brk(0x8061000)                    = 0x8061000
4535  ioctl(0, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
4535  ioctl(0, SNDCTL_TMR_START, {B38400 opost isig icanon echo ...}) = 0
4535  ioctl(0, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
4535  open("/root/.terminfo/v/vt100", O_RDONLY) = -1 ENOENT (No such file or dir
ectory)
4535  open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
4535  fstat64(3, {st_mode=S_IFREG|0644, st_size=1143, ...}) = 0
4535  old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40017000
4535  read(3, "\32\1,\0\25\0\7\0\16\1\377\1vt100|vt100-am|dec v"..., 4096) = 114
3
4535  brk(0x8062000)                    = 0x8062000
4535  close(3)                          = 0
4535  munmap(0x40017000, 4096)          = 0
4535  ioctl(1, 0x5413, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
4535  write(2, "Your terminal lacks the ability "..., 64) = 64
4535  write(2, "\r\n", 2)               = 2
4535  _exit(1)                          = ?
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 8:53 pm    Post subject: Reply with quote

Gigantopithicus wrote:

4535 open("/root/.terminfo/v/vt100", O_RDONLY) = -1 ENOENT (No such file or dir
ectory)
4535 open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3
4535 fstat64(3, {st_mode=S_IFREG|0644, st_size=1143, ...}) = 0
4535 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40017000
4535 read(3, "\32\1,\0\25\0\7\0\16\1\377\1vt100|vt100-am|dec v"..., 4096) = 114
3
4535 brk(0x8062000) = 0x8062000
4535 close(3) = 0
4535 munmap(0x40017000, 4096) = 0
4535 ioctl(1, 0x5413, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
4535 write(2, "Your terminal lacks the ability "..., 64) = 64
4535 write(2, "\r\n", 2) = 2
4535 _exit(1) = ?[/code]


As you can see, the program loads in the correct values in the following line:
4535 read(3, "\32\1,\0\25\0\7\0\16\1\377\1vt100|vt100-am|dec v"...,

It then issues an ioctl command to set the rows to 24, columns to 80 with the line:
535 ioctl(1, 0x5413, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0

However the next line shows the error you reported.
Somehow the program you are running check the terminal for capabilities or some library does that is not shown in the strace output.

Here is my output from the same command, strace -f -o xyz nano -w somefile.txt:

21177 open("/usr/share/terminfo/x/xterm", O_RDONLY) = 3
21177 fstat64(3, {st_mode=S_IFREG|0644, st_size=1415, ...}) = 0
21177 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
21177 read(3, "\32\1\'\0\17\0\17\0i\1U\2nxterm|xterm-color|g"..., 4096) = 1415
21177 brk(0x8063000) = 0x8063000
21177 close(3) = 0
21177 munmap(0x40017000, 4096) = 0
21177 ioctl(1, 0x5413, {ws_row=66, ws_col=153, ws_xpixel=0, ws_ypixel=0}) = 0
21177 brk(0x8065000) = 0x8065000
21177 rt_sigprocmask(SIG_BLOCK, [INT QUIT TSTP TTIN TTOU WINCH], [RTMIN], 8) = 0
21177 open("/dev/tty", O_RDWR) = 3
21177 ioctl(3, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0

As you can see, the path taken inside nano is different. Hmm.
Can you check that your /etc/ld.so.conf includes:
/usr/lib
/lib
/usr/local/lib
/usr/X11R6/lib
as a minimum and try to rerun:
ldconfig to recreate the ld cache.

I guess the next thing to do would be to put on some debugger flag and recompile nano, then run it in gdb to see where it actually fails.
I'll check the nano source too see where it craps out.

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 9:05 pm    Post subject: Reply with quote

Don't waste your time debugging the nano source. Pico craps out the same way.

I think we are are the right path. Here are the contents of ld.so.conf:

/usr/local/lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3
/usr/lib/opengl/xfree/lib
/usr/lib/mozilla
/usr/X11R6/lib
/usr/qt/3/lib
/usr/qt/2/lib
/usr/kde/3/lib
/usr/kde/2/lib

I'm going to make the proper changes. I'll post results in a few. I'm not sure how it missed /usr/lib and /lib. I don't recall removing those entries at all.
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Tue Sep 03, 2002 9:21 pm    Post subject: Reply with quote

ok. Still didn't help. Did it two ways to add /lib and /usr/lib:
1) editted /etc/env.d/00basic and added /lib and /usr/lib to the ldpath statement, then did env-update.
2) editted /etc/ld.so.conf and added them manually, then did ldconfig to add to cache.

/lib and /usr/lib are there in ld.so.conf... ugghhh... this is so frustrating. I'll have to revisit this issue tomorrow.

Here are the contents now of /etc/ld.so.conf:

/usr/local/lib
/usr/lib
/lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3
/usr/lib/opengl/xfree/lib
/usr/lib/mozilla
/usr/X11R6/lib
/usr/qt/3/lib
/usr/qt/2/lib
/usr/kde/3/lib
/usr/kde/2/lib
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Sep 03, 2002 10:03 pm    Post subject: Reply with quote

Gigantopithicus wrote:
ok. Still didn't help. Did it two ways to add /lib and /usr/lib:
1) editted /etc/env.d/00basic and added /lib and /usr/lib to the ldpath statement, then did env-update.
2) editted /etc/ld.so.conf and added them manually, then did ldconfig to add to cache.

/lib and /usr/lib are there in ld.so.conf... ugghhh... this is so frustrating. I'll have to revisit this issue tomorrow.

Here are the contents now of /etc/ld.so.conf:

/usr/local/lib
/usr/lib
/lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3
/usr/lib/opengl/xfree/lib
/usr/lib/mozilla
/usr/X11R6/lib
/usr/qt/3/lib
/usr/qt/2/lib
/usr/kde/3/lib
/usr/kde/2/lib


Hmm, that is really strange.

Well, I did some debugging of nano, even you told me not too :-P
The problem is within a curses function called initscr(). So I traced through the ncurses source to see where we actually fail:
_nc_get_screensize(&LINES, &COLS);
I can see that we get to this point as the strace output shows we are getting the screensize from the terminfo file.

From here on, it is just a guess. I also searched the ncurses files for a similar message as the one you reported in your first post, about missing the ability and so forth, but I couldn't find this in the source.

Which version of ncurses are you running?
You are running this as root as far as I can see. Do you get the same error if you log in as a normal user? What if you swicth to a text based console by hitting ctrl+alt+f1 and try to run nano there, same error?

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Wed Sep 04, 2002 1:01 am    Post subject: Reply with quote

Ok, started console as different user (now physically at the box). Still same prob. Alt-F2, create new console as root, same problem.

Ncurses version is 5.2-r5.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Wed Sep 04, 2002 1:36 am    Post subject: Reply with quote

Gigantopithicus wrote:
Ok, started console as different user (now physically at the box). Still same prob. Alt-F2, create new console as root, same problem.

Ncurses version is 5.2-r5.

Aha!!!! That figures!
You didn't read the package.mask file did you?

#still not working:
=sys-libs/ncurses-5.2-r4

Where did you get the -r5 from?

Remove the # on the ncurses line and get a working ncurses. Mine is:
5.2.20020511-r2

Bad boy! Don't mess with package masks unless you are sure it's working. First thing you do when a masked package is not working for you, is to get back to the regular package.

Hope this helps! 8)

Erik
Back to top
View user's profile Send private message
Gigantopithicus
n00b
n00b


Joined: 05 Aug 2002
Posts: 17
Location: Chicago, IL

PostPosted: Wed Sep 04, 2002 9:52 pm    Post subject: Reply with quote

Erik,
Thank you for all your help. You are great. I ended up bungling my ncurses. Since it was just a 'fun' box, I tore it down and rebuilt it again. Adios :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum