Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Dear Monks,
I'm working on implementing a simple data entry thingy and connect to an AnyEvent::Handle via the telnet command-line program. I'm trying to get it to not just "read" on getting a newline, but also on pressing arrow keys. I know that I can register a different EOL character via ::Handle's push_read() method, but I haven't got it to work on my terminal, btw. which is Ubuntu's default, where I then run the default telnet command.

What *does* work is a procedure like:
  1. I enter a "right arrow",
  2. the terminal then echoes the char "^[[C") and
  3. I press ENTER after that,
  4. the "special arrow char" is transmitted.
Of course, as ::Handle by default operates on the newline/carriage-return and transmits all the stuff before that.


My second hunch was that maybe telnet always only transmits upon ENTER, but I've tried other people's telnet applications where my telnet DOES transmit arrow keys and also the local echo'ing of the special arrow keys on my end is suppressed. How does that work? Do such applications send a special "handshake" that puts my telnet + shell into "application mode" or how is such a remote telnet handle configured to munge chars terminated by a newline/ENTER *and* special key input, like arrow keys?

I hope someone with knowledge from the olden times when telnet was in vogue can shed some light. If that's possible with AnyEvent::Handle. And how I can go forth from here.
Thanks a ton already!

In reply to How do I get AnyEvent::Handle to munge arrow keys? by isync

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found