The module and every import move from github.com/racingmars/go3270 to
github.com/D-Modem/go3270, so the fork no longer needs a replace line in
the programs that use it. The upstream files' 'This file is part of'
headers keep their attribution.
The README becomes a landing page that credits upstream; usage, code
pages, the fork's graphics and IND$FILE, and the 3270 references move to
docs/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
- decodeBufAddr's binary case is 14-bit addressing, not 16-bit; eor is
0xef, not 0xf1; dftExchange's comment names it; "If the user pressed".
- gfxtest: sf0F's unused out parameter dropped; a failed Erase/Reset
(PF6) ends the session like any other write; the origin comment no
longer offers T, which the settings never took; a stray comment gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
- ParseIndFile keeps a "(" within a name, so 'USER.DATA(MEM)' and
USER.DATA(MEM) keep their member, and RECFM(V)-style options stay
whole; a CMS "(" (alone, at a word's start, or "fm(ASCII") still
begins the options.
- makeDeviceInfo: a client that does not answer the Query gets its
model's size (43x80 for a -4), not always 24x80; IBM-DYNAMIC with
replies but no Usable Area is 24x80, not 0x0.
- ReadRecord returns a read error inside a subnegotiation rather than
reading on.
- codepage/generate's read returns its errors, naming the line, instead
of panicking.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Every function and method, tests included, has a doc comment: what it
is or does, what it returns and anything a caller needs to know. Only
comments are added; gofmt split a few aligned blocks of one-line
functions once each had its own comment. The generated protobuf code
is left as protoc writes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
LoadPS.Plane (PlaneBlue, PlaneRed, PlaneGreen) loads the symbols into
one plane of a triple-plane symbol set: the extended form through byte
12, the color plane (GA23-0059 5.13.2), format 1's cell given as 9x16.
A cell whose color attribute is neutral shows its planes' colors added,
blue and red making pink: 8 colors a pel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
An AttributeOnly field's CharSet is sent as a Set Attribute (type 0x43)
for the characters after it, and DefaultCharSet sets it back: programmed
symbols from more than one set, and in their own colors, within a field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The terminal's graphics palette (its Graphic Color query reply, or the
8 base colors) and an image error-diffused to it, a bitmap a color for
ImagePictures with overpaint, move from gfxtest into the library for the
BBS's pictures; gfxtest uses them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A character over graphics clears them in its cell (PCOMM: "Hole in
Screen Caused by Clearing a Graphic Character"), and so does the
cursor: test 4's labels were on row 4, the row,col square's row, and the
cursor on the top left square. The labels go to rows 6-9, the cursor
after Enter=back; the picture's caption no longer wraps onto row 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
NegotiateTelnet: IBM Personal Communications lists its graphics replies
(A8, B0-B6) in its Summary but sends them only for a Query List, so a
Query List now asks for whatever the Summary lists that did not come
(a client that does not answer is waited for 3 seconds). The Graphic
Color reply, PCOMM's 16 colors, is there from the start.
ImagePictures: each bitmap cropped to its pels, a picture over 64K
split into segments of their own (named B001 on, from a first number
given), a bitmap into bands of rows if need be, the mix given.
gfxtest draws with it: size L fills the space below the picture's row,
the corner markers each have a segment of their own, and origin T (y
down, which cropping cannot follow) is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
With mix O the image test diffuses the picture (Floyd-Steinberg) to the
colors in the terminal's Graphic Color query reply (B4) - IBM Personal
Communications has 16, orange, purple, the dark shades and grey among
them - a bitmap a color, black left as the background; without the reply,
the 8 base colors. The preview draws in the same palette.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
IBM Personal Communications lists the Segment reply (B0) and the other
graphics replies in its Summary but does not send them for a Query, so
SupportsVectorGraphics said no to a terminal that draws them. It now
takes B0 in the Summary too.
gfxtest: with mix O the image test sends a bitmap per colour, each pel in
one, overpainted (no exclusive or); test 9 sends a Query List for the
replies the Summary lists that did not come; the trace logs telnet
commands on their own rather than as the start of the next record.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
The image test's caption and the log give the file's decoded size,
format and length and the size drawn, and -preview DIR writes what the
terminal should show (the planes XOR'd, or overpainted) to compare with
what it does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Shows the terminal's query replies, draws Object Picture test pictures
(test pattern, colour bars as XOR planes or bitmaps, corner markers, a
dithered image) with the origin, position, size, mix and order as
settings, sends structured fields typed in hex, and logs every record
both ways with the graphics orders and inbound replies decoded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
ParseIndFile reads the "IND$FILE GET|PUT name [(] options" an emulator
types (TSO and VM/CMS forms). SendFileDFT (GET) and ReceiveFileDFT
(PUT) run the transfer with Data Transfer structured fields: open,
insert or set cursor and get, close, with the request layouts of a real
TSO IND$FILE (x3270's s3270/Test/ft_dft.trc); DFTMessage ends it with
IND$FILE's message. DFTBufferSize reads the terminal's DFT buffer from
its DDM query reply (0 when it has no DFT). ReadRecord reads one
inbound record, which the screen functions cannot (the AID is 0x88).
Tested with s3270 through bbs-sec: binary and ASCII CRLF files both
ways, and a GET of a file that is not there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
NegotiateTelnet keeps every query reply the client sends, and DevInfo
gives them out: QueryReply, QueryCodes, CellSize (from Usable Area),
SymbolSets (the Character Sets reply: GE, Load PS support, formats,
slot size, the sets and their RWS and LCID) and SupportsVectorGraphics
(the Segment reply).
LoadPS builds the Load Programmed Symbols structured field (formats 1
and 3, basic or extended) from Symbol bitmaps; WriteStructuredFields
sends structured fields; Field.CharSet (SFE type 0x43) and Field.Raw
show the symbols. ImagePicture builds an Object Picture structured
field drawing bitmaps with native vector graphics (experimental).
Fixes: a query reply shorter than 4 bytes made NegotiateTelnet panic
(slice of negative length, index out of range), which any client could
send; the replies a client may send are limited to 16 KB; encoded field
text is telnet-escaped, so a character a code page maps to 0xFF cannot
end the record or start a telnet command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Respond to client "do" requests during the negotiation. This prevents the
negotiation from failing when connecting from the z/VM and CSI z/VSE telnet
clients.
Also don't treat unknown terminal device type as an error, just fall back on
assuming a 24x80 terminal. This shouldn't affect z/VM / z/VSE clients, which
identify correctly, but will return to the original go3270 behavior of not
caring about specific client device type.
This is a relatively big new feature, which introduces small breaking changes
to the API:
* NegotiateTelnet() now returns (DevInfo, error) instead of just error. The
function signature for the Tx type now has one additional DevInfo parameter.
* RunTransactions() requires one additional parameter, the DevInfo (which is
allowed to be nil).
Otherwise, existing behavior continues to work as-is and everything still
defaults to operating on the default 24x80 terminal size.
See example5 for a larger-terminal-aware application.
Pending some time to make sure no new bugs cropped up in this release and that
the alternate screen size support works in the wild, I anticipate this will
become the v1.0.0 release of go3270.
There was already a feature, Field.KeepSpaces, for the programmer to control
this. The new strip-only-trailing-spaces behavior was inconsistent with the
original design.
New ShowScreenOpts() function, which takes a new ScreenOpts struct, to control
various aspects of the ShowScreen behavior. This should now be used in favor of
the deprecated ShowScreen() and ShowScreenNoResponse() functions, and allows
for the additional of future options without needing to continue making new
functions or breaking the public API.