mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-06-18, 03:31   #1
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135448 Posts
Default Readline problems

I'm having trouble with readline and wondered if anyone had similar experiences or could tell me what may be wrong.

When I come to the end of a line, the cursor goes back to the beginning of the same line and overwrites the text. When going back it won't display the displaced text either. And occasionally (typically when dealing with similarly 'long' lines) text will appear on a line that isn't in the edit buffer:
> thisIsFromTheLastCommand1+1
where only the "1+1" is part of the current line and I can't backspace past it.

In this case I'm using Pari
Code:
                 GP/PARI CALCULATOR Version 2.4.3 (development)
          amd64 running linux (x86-64/GMP-4.3.1 kernel) 64-bit version
           compiled: Jun  2 2009, gcc-4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
                 (readline v5.2 enabled, extended help enabled)
but I imagine the problem is generic.
CRGreathouse is offline   Reply With Quote
Old 2009-06-18, 05:18   #2
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

22×3×499 Posts
Default

I've downloaded and built readline 6.0. I'm curious to see if that fixes the problem.
CRGreathouse is offline   Reply With Quote
Old 2009-06-18, 06:40   #3
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

176416 Posts
Default

6.0 does not fix the problem. Curiously, it's still reported as v. 5.2:
Code:
                 GP/PARI CALCULATOR Version 2.4.3 (development)
          amd64 running linux (x86-64/GMP-4.3.1 kernel) 64-bit version
           compiled: Jun 18 2009, gcc-4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
                 (readline v5.2 enabled, extended help enabled)
Does this mean I have tow versions of readline on my computer, or just that Pari detects it wrong?
CRGreathouse is offline   Reply With Quote
Old 2009-06-19, 02:08   #4
lfm
 
lfm's Avatar
 
Jul 2006
Calgary

52·17 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I'm having trouble with readline and wondered if anyone had similar experiences or could tell me what may be wrong.

When I come to the end of a line, the cursor goes back to the beginning of the same line and overwrites the text. When going back it won't display the displaced text either. And occasionally (typically when dealing with similarly 'long' lines) text will appear on a line that isn't in the edit buffer:
> thisIsFromTheLastCommand1+1
where only the "1+1" is part of the current line and I can't backspace past it.

In this case I'm using Pari
Code:
                 GP/PARI CALCULATOR Version 2.4.3 (development)
          amd64 running linux (x86-64/GMP-4.3.1 kernel) 64-bit version
           compiled: Jun  2 2009, gcc-4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
                 (readline v5.2 enabled, extended help enabled)
but I imagine the problem is generic.
You could try ctrl-r to repaint the line. It maybe doesn't know what column it is starting at so it doesn't handle the wrap to next line right.
lfm is offline   Reply With Quote
Old 2009-06-19, 03:06   #5
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

22·3·499 Posts
Default

That doesn't work very well for me.

Here's a composite of three screenshots. First shows the problem, second the apparent quick-fix solution with Ctrl+R (though note superfluous text to the right of cursor), third what I see if I go to the beginning of the line. Note the character misalignment.

But ideally I'd have it working without the need for a special key combination at all...
Attached Thumbnails
Click image for larger version

Name:	ss.png
Views:	184
Size:	9.3 KB
ID:	3796  
CRGreathouse is offline   Reply With Quote
Old 2009-06-19, 08:59   #6
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

The behaviour sounds like what bash's readline does when you have changed the window size, but readline still assumes the old screen dimensions. It gets all confused over where a line is supposed to wrap around. Maybe you can fix it by telling readline the number of columns and rows of your screen, maybe via the .inputrc file, or via the LINES and COLUMNS environment variables?

Alex
akruppa is offline   Reply With Quote
Old 2009-06-20, 05:18   #7
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

598810 Posts
Default

Changing LINES and COLUMNS didn't help.

It may be worth mentioning that bash has no such trouble.
CRGreathouse is offline   Reply With Quote
Old 2009-06-20, 12:55   #8
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

25416 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
6.0 does not fix the problem. Curiously, it's still reported as v. 5.2:
Code:
                 GP/PARI CALCULATOR Version 2.4.3 (development)
          amd64 running linux (x86-64/GMP-4.3.1 kernel) 64-bit version
           compiled: Jun 18 2009, gcc-4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
                 (readline v5.2 enabled, extended help enabled)
Does this mean I have tow versions of readline on my computer, or just that Pari detects it wrong?
Is readline statically linked with GP/PARI? Check with way:
Code:
ldd whatever_it_s_named
If readline.so appears here, you need to point LD_LIBRARY_PATH where your new readline.so is:
Code:
export LD_LIBRARY_PATH=/path/to/directory/where/readline/is:${LD_LIBRARY_PATH}
The behavior Alex describes for bash happens when you resize your terminal window while bash is not active (when for instance running a program in foreground from that terminal).
ldesnogu is offline   Reply With Quote
Old 2009-06-20, 18:26   #9
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

22·3·499 Posts
Default

Quote:
Originally Posted by ldesnogu View Post
Is readline statically linked with GP/PARI? Check with way:
Code:
ldd whatever_it_s_named
If readline.so appears here, you need to point LD_LIBRARY_PATH where your new readline.so is:
Code:
export LD_LIBRARY_PATH=/path/to/directory/where/readline/is:${LD_LIBRARY_PATH}
OK, this seemed like it would solve my problem, given that I compiled readline 6.0 but the program said it was using 5.2. So after a merry game of hiding files from Configure, since the hint --with-readline=/usr/local/lib wasn't enough, I managed to get it to compile like so:

Code:
                 GP/PARI CALCULATOR Version 2.4.3 (development)
          amd64 running linux (x86-64/GMP-4.3.1 kernel) 64-bit version
           compiled: Jun 20 2009, gcc-4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
                 (readline v6.0 enabled, extended help enabled)
Unfortunately, this seems to have just the same problem. Configure results:
Code:
Configuring pari-2.4.3 (DEVELOPMENT VERSION) 
Checking echo to see how to suppress newlines...
...using \c
Looking for some tools first ...
...ld is /usr/bin/ld
...zcat is /bin/zcat
...gzip is /bin/gzip
...ranlib is /usr/bin/ranlib
...perl is /usr/bin/perl
Looking for the compilers ...
...cc is /usr/bin/cc
...gcc is /usr/bin/gcc
GNU compiler version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
Given the previous choices, sizeof(long) is 8 chars.
The internal word representation of a double is not needed (64bit).
==========================================================================
Building for: amd64 running linux (x86-64/GMP kernel) 64-bit version
==========================================================================
C compiler is          /usr/bin/gcc -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -fPIC
Executable linker is   /usr/bin/gcc  -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -Wl,--export-dynamic 
Dynamic Lib linker is  /usr/bin/gcc  -shared  $(CFLAGS) $(DLCFLAGS) -Wl,-shared,-soname=$(LIBPARI_SONAME)
Looking in C lib for some symbols...
...I did not find exp2.
...I did not find log2.
...Found strftime.
...Found getrusage.
...Found sigaction.
...Found TIOCGWINSZ.
...Found getrlimit.
...Found stat.
...Found vsnprintf.
...Found waitpid.
...Found setsid.
...Found getenv.
...Found isatty.
...I did not find dlopen.
Try again, with -ldl this time...
...Found dlopen.
Checking for optional libraries and headers...
...Found libgmp in /usr/local/lib
...Found gmp header in /usr/local/include
Using GNU MP, version 4.3.1
...Found libX11 in /usr/lib
...Found X11 header files in /usr/include/X11
Hi-Res Graphics: X11
...Found libreadline in /usr/local/lib
...Found readline header in /usr/local/include/readline
...Found history header in /usr/local/include/readline
...Found libncurses in /usr/lib64
...Library ncurses needed by readline
Using GNU readline, version 6.0
Installation prefix ? [/usr/local]
...for architecture-independent files (share-prefix) ? [/usr/local/share]
Installation directories for:
...executables (gp, gphelp) ? [/usr/local/bin]
...libraries (libpari) ? [/usr/local/lib]
...include files ? [/usr/local/include]
...manual pages ? [/usr/local/share/man/man1]
...other system-dependent data ? [/usr/local/lib/pari]
...other system-independent data ? [/usr/local/share/pari]
Default is dynamic executable and shared library
==========================================================================
Extracting examples/Makefile.linux-x86_64
Extracting Olinux-x86_64/Makefile
Extracting Olinux-x86_64/../Odos/paricfg.h
Extracting Olinux-x86_64/paricfg.h
Extracting Makefile
Extracting scripts and macros
...in doc
...in misc
==========================================================================
Shall we try to build pari 2.4.3 (development) now (y/n)? [n]
Ok. Type "make install" when you are ready
Bye !
CRGreathouse is offline   Reply With Quote
Old 2009-06-20, 20:37   #10
lfm
 
lfm's Avatar
 
Jul 2006
Calgary

52×17 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I'm having trouble with readline and wondered if anyone had similar experiences or could tell me what may be wrong.
What terminal program are you using? Try the plain old xterm, it could be a bug in the terminal program's handling of the escape sequences.
lfm is offline   Reply With Quote
Old 2009-06-20, 21:00   #11
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135448 Posts
Default

Nope, it still fails even in xterm.
Attached Thumbnails
Click image for larger version

Name:	fail.png
Views:	169
Size:	1.3 KB
ID:	3803  
CRGreathouse is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overheating Problems 160274 Hardware 4 2010-12-13 06:33
PC problems Nimras Information & Answers 6 2009-12-15 21:24
Need help with few problems Laserjet Hardware 1 2007-10-13 10:59
Two problems gribozavr Puzzles 11 2007-02-05 05:46
Need help, laptop problems Citrix Hardware 5 2005-09-07 15:04

All times are UTC. The time now is 09:38.


Fri Mar 24 09:38:43 UTC 2023 up 218 days, 7:07, 0 users, load averages: 1.01, 0.86, 0.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔