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.