Unexpected behaviour of Highline metod ask!

Discussion in 'Ruby' started by Buda & Nada, Jun 17, 2009.

  1. Buda & Nada

    Buda & Nada Guest

    Hi!

    I am having an unexpected behaviour when the follwoing code is
    executed:

    pass = ask("Enter your password: ") { |q| q.echo = "x" }

    As I enter characters there is not instantenious echo of the "x"
    character. Instead, nothing is echoed until <enter> is hit when all
    "x" characters do appear. Is this the intention here. For would
    think that "x" characters should after each press of any character.

    I would apprecite a commnet.

    Bud M
     
    Buda & Nada, Jun 17, 2009
    #1
    1. Advertising

  2. Buda & Nada

    Axel Guest

    In case you don't get a better answer (I've experiences with highline,
    but not with 'echo'):

    If you are on Windows, maybe it does not work.

    If you are on Linux/Unix, do you have everything from the
    documentation:

    "
    echo:
    This requires HighLine’s character reader. See the character attribute
    for details.

    Note: When using HighLine to manage echo on Unix based systems, we
    recommend installing the termios gem. Without it, it’s possible to
    type fast enough to have letters still show up (when reading character
    by character only).
    "

    -Axel
     
    Axel, Jun 17, 2009
    #2
    1. Advertising

  3. Buda & Nada

    James Gray Guest

    On Jun 17, 2009, at 12:10 AM, Buda &amp; Nada wrote:

    > Hi!


    Hello.

    > I am having an unexpected behaviour when the follwoing code is
    > executed:
    >
    > pass = ask("Enter your password: ") { |q| q.echo = "x" }
    >
    > As I enter characters there is not instantenious echo of the "x"
    > character. Instead, nothing is echoed until <enter> is hit when all
    > "x" characters do appear. Is this the intention here. For would
    > think that "x" characters should after each press of any character.
    >
    > I would apprecite a commnet.


    As Axel pointed out, your platform may matter in this case. Can you
    tell us what you are using?

    James Edward Gray II
     
    James Gray, Jun 17, 2009
    #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. Ira Baxter
    Replies:
    0
    Views:
    802
    Ira Baxter
    Jun 27, 2003
  2. SMeddows

    Metod Documentation in WSDL

    SMeddows, Jan 16, 2009, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    688
    SMeddows
    Jan 16, 2009
  3. Ruby Quiz

    [QUIZ] HighLine (#29)

    Ruby Quiz, Apr 22, 2005, in forum: Ruby
    Replies:
    8
    Views:
    144
    James Edward Gray II
    Apr 22, 2005
  4. Ryan Leavengood

    [SOLUTION] HighLine (#29)

    Ryan Leavengood, Apr 24, 2005, in forum: Ruby
    Replies:
    6
    Views:
    118
    James Edward Gray II
    Apr 29, 2005
  5. Jeremy Pruitt

    Highline: Can I "ask" to STDERR

    Jeremy Pruitt, Oct 6, 2008, in forum: Ruby
    Replies:
    3
    Views:
    87
    Ken Bloom
    Oct 12, 2008
Loading...

Share This Page