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. Advertisements

  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. Advertisements

  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. Advertisements

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. Mark
    Replies:
    4
    Views:
    3,115
    scoude
    Jan 12, 2011
  2. Steven Van den Berghe

    unexpected map behaviour

    Steven Van den Berghe, Aug 28, 2003, in forum: C++
    Replies:
    2
    Views:
    545
    Christian Janßen
    Aug 28, 2003
  3. Old Wolf
    Replies:
    1
    Views:
    493
    Victor Bazarov
    Feb 4, 2004
  4. Ioannis Vranos

    Unexpected behaviour

    Ioannis Vranos, Sep 23, 2004, in forum: C++
    Replies:
    36
    Views:
    1,073
    Rolf Magnus
    Sep 24, 2004
  5. Richard Philips

    Unexpected python behaviour

    Richard Philips, Nov 28, 2003, in forum: Python
    Replies:
    2
    Views:
    416
    Jay O'Connor
    Nov 28, 2003
  6. Simon Wittber

    Unexpected mod-python behaviour.

    Simon Wittber, Feb 4, 2004, in forum: Python
    Replies:
    1
    Views:
    365
    Bengt Richter
    Feb 6, 2004
  7. SMeddows

    Metod Documentation in WSDL

    SMeddows, Jan 16, 2009, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    811
    SMeddows
    Jan 16, 2009
  8. Jeremy Pruitt

    Highline: Can I "ask" to STDERR

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