Function keys in Telnet don't work.

I’ve used telnet a billion times but only for command line use. I’ve never used the function keys (F1, F2, etc)

I have a unix machine which is normally used at the terminal itself, but accessing it remotely would make life a hell of alot easier.

I can hit it using telnet, login, and open the application. The problem is I need the function keys to enter options. When I hit a function key it types something like M[.

I’ve heard of mapping keys in telnet but am not sure of how to do it or if this solves the problem. I did a few searches on google but mostly found how to use function keys on an AS/400 or other such business.

One thing the server does when I log in is ask for a term mode. With a little hit and miss I found VT102 seemed to display the screen the best.

I’m using Ewan as a client, but I’m open to anything that will work. The client machine is an XP Pro. The server is some unix machine I’m not too hip on. (I just use it for a handful of utilities - someone else manages it. When I hit the machine on telnet it prints UnixWare 2.1.2 (DY0052PF) (pts/0))

Anyone have clues of where to start?

You might want to try TeraTerm, that’s what I always used. It’s free.

http://www.tivohelp.com/archive/tivohelp.swiki.net/38.html

http://hp.vector.co.jp/authors/VA002416/teraterm.html

Nope. Same thing.

What’s the application?

The problem might be that Telnet can only send and receive 8-bit characters (ASCII and maybe extended ASCII). The F-keys are not in the ASCII set, so emulating them is a bit of a hack. Extra keys like the Fn and the arrow keys are often sent as multiple-key combinations, usually an escape (the M-[ you saw) followed by a few more characters. Some applications understand these multikey codes, but some applications (especially those designed for local PC use) use the keyboard’s keycodes to sense keypresses at a lower level. This low-level keyboard interface won’t work over Telnet.

Unix applications often use the “curses” library to read a keyboard input stream and parse it into keypresses. To distinguish between these multikey combinations and the equivalent typed-out characters (an up arrow, for example, is “ESC [ A”) there’s a timeout set for completion of the multikey string. If this is set too low the curses routines might not be correctly grouping the F-key string on the receiving end. This can sometimes be changed either by changing the terminal type or with stty. (You might try “stty time 3” or something similar.)

Memory’s a little hazy, but there’s a unix command (stty) that allows you to bind keys for the current session. I remember that “stty erase ^H” binds the Unix delete key to the windows backspace key (^H is the backspace key).

I’m not sure if the stty command will allow you to bind function keys. Here’s the man pages for stty: http://unixhelp.ed.ac.uk/CGI/man-cgi?stty

I got this figured out so I thought I’d post here in case it is needed by someone else.

I found some software by Avaya which emulates various terminal modes. Turns out the one I was dealing with is ATT4410.

The cool thing about Avaya’s Terminal Emulation software is it has Function keys built into the software. It also supports a TON of different terminals.

Good stuff.