wierd cut and paste issue with irb

Discussion in 'Ruby' started by Jason Wold, Jan 20, 2006.

  1. Jason Wold

    Jason Wold Guest

    ------=_Part_669_9637204.1137726502887
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    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 i=
    n
    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
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxx"
    | wc -c
    1000

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

    /frustrated
    Jason

    ------=_Part_669_9637204.1137726502887--
     
    Jason Wold, Jan 20, 2006
    #1
    1. Advertising

  2. Jason Wold

    Jason Wold Guest

    ------=_Part_677_21926391.1137726603883
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    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

    On 1/19/06, Jason Wold <> wrote:
    >
    > 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 100=

    0
    > 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 mo=

    re
    > if the string is longer.
    >
    > irb(main):008:0> puts "x"*1000
    > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
    xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    > | wc -c
    > 1000
    >
    > Up until now I have been using irb as a shell to do set operations...now =

    I
    > am afraid.
    >
    > /frustrated
    > Jason
    >


    ------=_Part_677_21926391.1137726603883--
     
    Jason Wold, Jan 20, 2006
    #2
    1. Advertising

  3. Jason Wold

    Michael Ulm Guest

    Jason Wold wrote:

    > 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 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:
    Visit our Website: www.isis-papyrus.com

    ---------------------------------------------------------------
    This e-mail is only intended for the recipient and not legally
    binding. Unauthorised use, publication, reproduction or
    disclosure of the content of this e-mail is not permitted.
    This email has been checked for known viruses, but ISIS accepts
    no responsibility for malicious or inappropriate content.
    ---------------------------------------------------------------
     
    Michael Ulm, Jan 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5nZWw=?=

    custom cut copy and paste

    =?Utf-8?B?QW5nZWw=?=, Jan 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    =?Utf-8?B?QW5nZWw=?=
    Jan 10, 2005
  2. Esteban

    Cut and paste images

    Esteban, Sep 14, 2004, in forum: Java
    Replies:
    5
    Views:
    5,049
  3. Stephen Boulet

    Cut and paste to X clipboard?

    Stephen Boulet, Jun 25, 2004, in forum: Python
    Replies:
    3
    Views:
    546
    Stephen Boulet
    Jun 29, 2004
  4. cam
    Replies:
    1
    Views:
    290
    Christopher T King
    Jul 9, 2004
  5. cam
    Replies:
    1
    Views:
    303
    Miklós
    Jul 10, 2004
Loading...

Share This Page