pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

ibm_hosts file is ignored if LU name provided on command line #44

Closed swhobbit closed 2 years ago

swhobbit commented 2 years ago

In environment such as Hercules where very few systems use port 23 and an emulated system of real the host running Hercules, connection to a system VM370 host on system linux may accessed by x3270 linux:3270; this leading to adding many systems to the x3270 ibm_hosts file.

However, if a hercules device group is specified as an LU (for example, to select a screen size), the Ibm_host file is silently ignored.

Expected behavior: The ibm_hosts file is still examined for an LU name is specified on the command line. If an LU port number is specified on the command line and ibm_hosts file, either:

pmattes commented 2 years ago

I have updated the online documentation to more clearly describe the current behavior. (It did already say that the names in ibm_hosts are mnemonics, not the FQDNs of hosts.)

At one point, ibm_hosts worked more like your first alternative. This turned out to be thoroughly confusing. E.g., if the ibm_hosts entry specifies the L: and Y: prefixes, and the command line specifies L:, does that mean that Y: should now be ignored (command-line completely overrides ibm_hosts), or both L: and Y: should still be applied (command-line augments ibm_hosts)? I can pick one behavior or the other; neither is obviously correct.

It is simpler, in terms of code, documentation and usability, to say that the names matched in ibm_hosts are strictly simple names. You are free to define the name 'foo' as 'foo:3270' there if you like, subject to that restriction.

There are many other ways to accomplish what it looks like you are trying to do. If you are always connecting to port 3270, then set 'x3270.port: 3270' in your ~/.x3270pro file. Or if you really like ibm_hosts, then specify 'host-4' as 'model4@hercules:3270' and 'host-5' as 'model5@hercules:3270'.

As for issuing a warning if someone specifies 'foo:3270' when there is an entry called 'foo', that would certainly be helpful if it was pointing out an error. But x3270 doesn't know if you expected it to work one way and it doesn't, or if you do understand how it works and expect it to work that way (as it has for many years). In the latter case, it would suddenly start telling you that it does not work in a different way than it is documented and you already understood -- every single time you use it that way.