Skip to content

Show the engine's terminal name in the mode tooltip (#202) - #203

Merged
coffeemuse merged 2 commits into
mainfrom
claude/issue-202-4a06dc
Oct 2, 2026
Merged

coffeemuse merged 2 commits into
mainfrom
claude/issue-202-4a06dc

Conversation

@coffeemuse

Copy link
Copy Markdown
Owner

Fixes #202.

What changed

The mode field's tooltip named the terminal from the profile (TerminalType.For). b3270 names it by its own rules (create_3270_termtype), so a colour model 4 or 5 showed 3279-4-E while the host was told IBM-3278-4-E, and a custom size showed 3279-2-E instead of IBM-DYNAMIC.

  • Backend: IndicationParser reads b3270's terminal-name indication. B3270Session.TerminalName keeps the latest report, and a disconnect leaves it alone.
  • Core: IEmulatorSession.TerminalName is null until the engine starts. TerminalType.For is now only the -model argument, and its comment says so.
  • App: StatusFormatter.ModeTip shows the name as reported, IBM- prefix included, the way x3270's About box does. Before the first connection attempt the tooltip says only "Not connected".
  • Docs: the user guide's status-bar passage names the terminal. Its mono row now says a mono profile tells the host "the terminal has no colour", because colour models 4 and 5 and every TN3270E connection also say 3278. The backend and Core CLAUDE.md notes and the CHANGELOG are updated, and the guide HTML is regenerated.

TN3270E

terminal-name and Query TerminalName both report termtype, the TELNET TERMINAL-TYPE name. Over TN3270E, b3270's DEVICE-TYPE request always asks for the 3278 form (tn3270e_request). Neither that request nor the host's DEVICE-TYPE IS reply (connected_type) is reported anywhere. The tooltip shows the reported name on every connection, as x3270 does, rather than LizTerm copying the RFC's 3278 rule. So a colour model 2 or 3 over TN3270E shows IBM-3279-2-E, and the user guide explains why. Checked in the 4.5ga6 source and in 4.6pre1.

Testing

  • Parser: Parses_terminal_name.
  • Session: Terminal_name_is_the_engines_latest_report_and_outlives_a_disconnect.
  • Replays: IBM-3279-2-E from the TN3270E ibmlink-help.jsonl, and IBM-DYNAMIC from oversize-100x50.jsonl.
  • Engine: EngineTerminalNameTests runs the bundled engine for colour models 2, 4 and 5, mono model 3 and a custom size. It checks session.TerminalName against Query TerminalName. This is the first real-engine confirmation of the model 4 and 5 names.
  • App: StatusFormatterTests and SessionViewModelTests are updated, and FakeEmulatorSession has a settable TerminalName.
  • dotnet test LizTerm.slnx: 0 failures. dotnet build --no-incremental: 0 warnings.
  • Hands-on (macOS, against MVS/CE over TN3270): colour models 2, 4 and 5, mono model 3 and a 100x50 custom size each showed the expected name in the tooltip: IBM-3279-2-E, IBM-3278-4-E, IBM-3278-5-E, IBM-3278-3-E and IBM-DYNAMIC. MVS/CE served a screen at 100x50 to IBM-DYNAMIC. TN3270E wasn't checked live, because there's no TN3270E test host.

🤖 Generated with Claude Code

coffeemuse and others added 2 commits October 2, 2026 16:15
The tooltip named the terminal from the profile (TerminalType.For), but b3270
names it by its own rules: a colour model 4 or 5 is IBM-3278-n-E and any custom
size is IBM-DYNAMIC. The backend now parses b3270's terminal-name indication and
exposes it as IEmulatorSession.TerminalName, and the tooltip shows it as
reported, as x3270's About box does. Before the engine starts there is no name
to show. TerminalType.For stays as the -model argument only.

Over TN3270E b3270 asks the host for the 3278 form and reports nothing about
it, so the tooltip shows the TERMINAL-TYPE name there too; the user guide says
so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The user guide, the backend notes and the indication's comment said TN3270E
  always asks for a 3278; a custom size still asks for IBM-DYNAMIC.
- The terminal name now dies with its engine (OnProcessEnded, TearDown), as the
  TLS options do, and is cleared before the Disconnected it raises, so a
  replacement that reports none cannot show its predecessor's.
- A terminal-name report with no text leaves the last name standing.
- TerminalType's summary no longer names b3270 in Core.
- ModeTip builds the connection sentence once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coffeemuse

Copy link
Copy Markdown
Owner Author

High review: fixes in e3cead9

The review raised 8 findings. 5 are fixed, 2 skipped and 1 was wrong.

Fixed

  1. TN3270E wording. The user guide, the backend CLAUDE.md note and the TerminalNameIndication comment said TN3270E always asks for a 3278. tn3270e_request uses create_3270_termtype(true), which is a 3278 even for a colour profile but still IBM-DYNAMIC for a custom size. All three now say so. (This PR's description has the same slip in its TN3270E section; this comment corrects it.)
  2. The name now dies with its engine. It's cleared in OnProcessEnded and TearDown, as _tlsOptions is, and in OnProcessEnded before the Disconnected state is raised. That keeps IEmulatorSession's promise that a caller can read it on ConnectionChanged. A replacement engine that reports no name can no longer show its predecessor's. New test: A_dead_processs_terminal_name_does_not_survive_into_its_replacement. The two replay tests now read the name while the engine is running: the ibmlink one when the TN3270E session comes up, the way the App reads it, and the oversize one before the engine exits.
  3. A report with no text keeps the last name. New test: A_terminal_name_report_without_text_keeps_the_last_name.
  4. TerminalType's summary no longer names b3270 in Core. Root CLAUDE.md says Core "never mentions Avalonia, b3270 or mvsMF".
  5. ModeTip builds the connection sentence once.

Skipped

  • The tooltip refreshes only on ConnectionChanged. b3270 reports a new name before the connection change that follows it (net_connect sets termtype before any change_cstate in 4.5ga6 host.c), and nothing LizTerm does changes the name while connected. A separate change event can come later if a backend ever needs it.

Not a problem

  • The name is read across threads without a barrier. It's the same pattern as Tls. The App marshals ConnectionChanged to the UI thread, and that hand-off orders the read after the reader thread's write.

dotnet test LizTerm.slnx: 0 failures. dotnet build --no-incremental: 0 warnings. The guide HTML is regenerated.

@coffeemuse
coffeemuse merged commit bad1721 into main Oct 2, 2026
6 checks passed
@coffeemuse
coffeemuse deleted the claude/issue-202-4a06dc branch October 2, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Status bar names the profile's terminal type, not the one the host is told

1 participant