Forum: Ruby wierd cut and paste issue with irb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5c0223a3a3fd877455f26c2cbde9038d?d=identicon&s=25 Jason Wold (jasonwold)
on 2006-01-20 04:46
(Received via mailing list)
I just mangled a bunch of data because pasting it into irb is dropping
characters for me.  The below is probably going to have really crappy
formatting but basically what I did is print a 1000 character long
string
(puts "x"*1000), copy that string, and paste it into double quotes and
append .size ("<paste>".size).  I copy 1000 characters but it only
pastes in
999!  If I paste the same string into shell not running irb I get all
1000
characters.

I'm using Eterm on Ubuntu linux but I have ruled out the Eterm since if
I
just exit irb and do the same thing with echo on the command line (echo
-n
"<paste>" | wc -c ) I get the correct number of characters.

I tried with both readline on and off, and saw no difference.  If I
paste
other 1000 byte strings in I might lose 1, 2, or 3 characters.  I lose
more
if the string is longer.

irb(main):008:0> puts "x"*1000
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
| wc -c
1000

Up until now I have been using irb as a shell to do set operations...now
I
am afraid.

/frustrated
Jason
5c0223a3a3fd877455f26c2cbde9038d?d=identicon&s=25 Jason Wold (jasonwold)
on 2006-01-20 04:49
(Received via mailing list)
OK, after further investigation this appears to be an issue just on
unbuntu
linux.  Works find on my friends mac and on his redhat system.  I'd be
interested if anyone else can recreate this on ubuntu.

Jason
F91f1034d620825594db83db92ca1711?d=identicon&s=25 Michael Ulm (Guest)
on 2006-01-20 12:21
(Received via mailing list)
Jason Wold wrote:

> "<paste>" | wc -c ) I get the correct number of characters.
I can reproduce it on Suse (SLES 9.2) with XTerm.
further investigation showed, that the problem turned up if
more than 512 characters were copied. Always the 511th
character (the one with index 510) was removed.
Strange.

Michael


--
Michael Ulm
R&D Team
ISIS Information Systems Austria
tel: +43 2236 27551-219, fax: +43 2236 21081
e-mail: michael.ulm@isis-papyrus.com
Visit our Website: www.isis-papyrus.com
This topic is locked and can not be replied to.