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:
- I enter a "right arrow",
- the terminal then echoes the char "^[[C") and
- I press ENTER after that,
- 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!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.