TN5250 garbage or VT100 screen after connecting to IBM i
IBM i could not agree a 5250 terminal type, so it fell back to VT100 or line mode. Set the session to TN5250 with type IBM-3179-2 or IBM-3477-FC and reconnect.
A screen full of stray characters, or a connected session that stays blank, usually means the 5250 session never started. The IBM i Telnet server sends a 5250 Sign On screen only after the client and server agree on a supported terminal type. When they cannot agree, the server switches to its fallback mode and sends something a 5250 client does not expect.
How the server picks a mode
At the start of every connection the client sends its terminal type, and both sides agree to use the Telnet Binary and End of Record options. RFC 1205 says a 5250 client must support all three. The server then chooses:
- 5250 full-screen when the type is one of IBM's 5250 names. This is the normal case.
- 3270 full-screen when the type is a supported 3270 name. IBM i translates 3270 into 5250 and maps the keys differently.
- The default network virtual terminal type when no supported type was agreed. The administrator sets it with
CHGTELNA DFTNVTTYPE:*VT100for VT100/VT220 full-screen mode, or*NVTfor ASCII line mode.
What each fallback looks like
- Escape codes, brackets and digits where the Sign On screen should be. The host is in VT100/VT220 mode and sends VT escape sequences. A VT client turns those into a usable screen; a client that expects 5250 shows them as text or a jumbled screen.
- Connected, but nothing appears. The host is in ASCII line mode. IBM says the server sends the sign-on display in every mode except line mode, where an application has to be running to show anything.
- Sign On appears, but F4 prints and F3 clears. That is 3270 mode, not a failed negotiation. See Using a 3270 emulator on IBM i (why F4 prints and F-keys need PA1).
Why the negotiation fails
- The session is set to VT or plain Telnet instead of 5250.
- The terminal type is not on IBM's list: a typo, a VT or xterm name, or a model the server does not support.
- A 3270 client sends a 3270 name the server does not list. IBM's list has extended (
-E) names only for model 2, such asIBM-3278-2-E, and IBM i shows 3270 clients only 24 x 80 screens, so set a 3270 client to model 2. - The client refuses the Binary or End of Record option.
- You reached a different service. A
login:prompt means a non-IBM Telnet server, and anSSH-2.0-...line means an SSH port. See Telnet to port 22: what the SSH-2.0 banner means.
Fix it
- Set the session type to 5250 (TN5250).
- Use a terminal type the server knows:
IBM-3179-2for a 24 x 80 color screen, orIBM-3477-FCfor 27 x 132 color.IBM-5251-11(24 x 80 monochrome) andIBM-3180-2(27 x 132 monochrome) are also on the list. - Check the port. Hosts normally use 23 for plain Telnet and 992 for TLS.
- Reconnect. If it still fails, get a trace and look for the
TERMINAL-TYPE ISline and anyDON'TorWON'Tanswers. See Telnet IAC codes: reading FF FB 01, WILL, WONT, DO and DONT in a trace.
If you have to stay in VT mode
VT mode works, but IBM says it is not the preferred mode. Screens are limited to 24 x 80, every keystroke goes to the server and back, and 5250 keys are typed as control keys or Esc sequences, for example Esc then 3 for F3. See IBM i VT100 key map: F1–F24, Field Exit, Error Reset, SysReq.
Related
- Can PuTTY or Windows Telnet connect to a mainframe or IBM i?
- IBM i VT100 key map: F1–F24, Field Exit, Error Reset, SysReq
- Using a 3270 emulator on IBM i (why F4 prints and F-keys need PA1)
- Telnet IAC codes: reading FF FB 01, WILL, WONT, DO and DONT in a trace
- How a 5250 terminal works
- IBM i Telnet connection refused, check that the Telnet server is running