Skip to content

go-ibmterm

A Go library to write servers for IBM block-mode terminals: TN3270 and TN5250. A program builds a screen from fields once. The library sends it as a 3270 or a 5250 data stream, and reads back the key and the values that the user typed.

go-ibmterm is the next version of D-Modem/go3270, which started as a fork of racingmars/go3270 by Matthew R. Wilson. bbs uses it for its 3270 and 5250 callers.

  • One screen model (ibmterm): ShowScreenOpts(), HandleScreen(), RunTransactions() and keys by name
  • tn3270: telnet negotiation, the screen sizes of models 1 to 5 and IBM-DYNAMIC, query replies, programmed symbols, vector graphics (Native and, experimental, Advanced), images and IND$FILE
  • tn5250: telnet negotiation with NEW-ENVIRON, 24x80 and 27x132 screens, colors and the 5250 keys
  • 31 EBCDIC code pages, detected from the client
  • cmd/gfxtest and cmd/tn5250test, servers to try the library on an emulator

Quick start

go get github.com/D-Modem/go-ibmterm
import (
    "github.com/D-Modem/go-ibmterm"
    "github.com/D-Modem/go-ibmterm/tn5250"
)

Then refer to example1 to example5 and cmd/tn5250test. To change a program from go3270, refer to docs/migration.md.

Documentation

The documentation is also a website, d-modem.github.io/go-ibmterm, with reference pages made from the code.

Licence

AGPL-3.0-only (LICENSE), or a commercial licence from the D-Modem Authors (COMMERCIAL-LICENSE.md). The code from upstream stays under its MIT licence (LICENSE-MIT) as well. The SPDX-License-Identifier line of each file tells which licence applies to it. Contributions come with a contributor agreement (CONTRIBUTING.md).