pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

wc3270 S3270 usage #24

Open kraabrsg opened 2 years ago

kraabrsg commented 2 years ago

Hi, thank you for this nice piece of software!

We want to use S3270 to browse or edit Datasets from a Terminal of Vscodium / VSCODE(We are on WIN10: 10,0,19042 Build 19042 ).

1.) We use normally IBM PERSCOM as 3270 application, the resolution here is set to 62x160. When this Resolution is set, we got an N54205 SCREEN SIZE MISMATCH Error after login in with S3270 (therefore it is needed to set a Resolution of 43x80 in PERSCOM to avoid this). Is there a way to overcome this issue? (Set(model=3279-4-E) , Codepage 1141) 1.1) We just made our first step with these applications, so is there a way to achieve a browse dataset without disconnecting an active perscom session ?

2.) When setting up wc3270 with the Wizard: wc3270.model: 4 wc3270.codePage: cp1141 wc3270.autoShortcut: true wc3270.verifyHostCert: true And when you start the app, resizing the window causes the line breaks to break, meaning, the lines don't start at line 1 (the image has a lot of black rectangles in it due to our security policies...) grafik

Thank you!

pmattes commented 2 years ago

To get 62x160, you need to set up 'oversze' (it's right under 'model number' in the Session Wizard).

The wc3270 window cannot be resized. There is no way for wc3270 itself to disable the resize operation on the window (it's an ordinary Windows Console window), so the official guidance is "please don't do that".

Your question 1.1 about dataset browsing is outside the scope of the terminal emulator, so I can't address it.

By the way, have you looked into wx3270? It's a lot friendlier than wc3270.

kraabrsg commented 2 years ago

Hi @pmattes thanks for your comments.

According to https://x3270.miraheze.org/wiki/HTTP_server WX3270 and X3270 supports Http server. I use the WX3270 1.0ga8 stable non exe download and extracted the gz file to a directory

But i am a little bit lost what to do next?

I know the configuration details to connect to the host (i managed that with S3270 from the commandline).

1.) is there a dummy guide on how to setup WX3270 (or X3270 or X3270if, what is "X3270if" exactly) for usage with an http Server, is this intended to be an interactive 3270 session as html site ?

2.) it would be the best option to have a portable install (the setup for WX3270 caused an error, i think it was the location where it should install the fonts),

3.) as result of 2, can the exe in "extern" folder be used to setup an http server... -> It would be awesome if we could open a webpage (127.0.0.1 ...) in VSCODIUM and use it there like a "real" 3270 perscom session....

in zowe desktop you have something like this allready (https://docs.zowe.org/stable/user-guide/mvd-using) grafik

Thanks!

pmattes commented 2 years ago

I think there is some confusion about what the x3270 HTTP server is intended for. It is used for remote control of the emulator, such as when running a script. You can use it to scrape the screen, send PF keys, etc. It does make x3270 usable interactively from a web browser.

I would love to be able to add that, but that is well beyond my web UI programming ability at the moment.

kraabrsg commented 2 years ago

hi @pmattes thanks for the comments, i think i understand it better now. I try to set it up with this project: https://github.com/MVS-sysgen/web3270 , instead

i could get up and running the wc3270 installation (no install), but still having problems with the screensize grafik

in the []hostname].wc3270 file i have set

grafik

(i use wc3270 because on windows, instead of c3270, hopefully that will work too with web3270)

i get the error when i try to login to TSO: N54205 SCREEN SIZE MISMATCH

(after cancel TSO und login again it works)

Thanks!

pmattes commented 2 years ago

I very strongly doubt that wc3270 will work with web3270, but if it does, please let me know! But in any case, I appreciate the reference to web3270, which I plan to experiment with as soon as possible.

As for the SCREEN SIZE MISMATCH error from TSO, that is because your host needs to be configured to support the larger screen size. I am not an experienced MVS admin, so I do not know how to do that.

kraabrsg commented 2 years ago

Well it is working now... grafik

it is using C3270 in a Docker container. To be able to run this was a bit complicated, because due to our companies security restrictions...

As for the SCREEN SIZE Error, i allready have a size exactly like specified in Perscom (can be seen on the screenshot above) with, e.g OVERSIZE of (62 x 160).

I requested to use X3270, because with C3270 the right CTRL key cannot be mapped as enter... https://github.com/MVS-sysgen/web3270/issues/2

pmattes commented 2 years ago

That's great to see! I will put a reference to web3270 in my Wiki.

I am still a bit confused about the screen size error. Does the mainframe config also include the model number, in addition to the number of rows and columns? That might need to match, too.

I understand the Right-CTRL issue (and there is the same issue with the Enter key on the keypad and shifted function keys). c3270 is necessarily limited that way because of how xterms (and the VT100s before them) operated.

I took a quick look at the web3270 code, and it is based on a character terminal emulation package. That makes it ideal for c3270. x3270 would need to be packaged quite differently, since it wants to talk to an X11 server. But maybe there is a browser-based X11 server out there (a bit like a VNC server) that would work.

schoko11 commented 2 years ago

I think i just provided oversize, without specifying a model (mentionend here: https://github.com/pmattes/x3270/issues/16 ) , not sure if model and oversize could be passed into web3270 (took no look into the source code) -> think so...

pmattes commented 2 years ago

I don't see any way to pass the oversize setting to web3270. How are you doing that? Or was this oversize issue only seen when using c3270 or wc3270 directly?

schoko11 commented 2 years ago

As of web3270 i am not sure if it is possible(i assume that the same parameters can be specified as in c3270, not tested tough -> web3270.ini).

the issue is the same on web3270 and wc3270/s3270 . (you have to cancel the tso session, and then it works).

will try setting model and oversize on monday

pmattes commented 2 years ago

I requested to use X3270, because with C3270 the right CTRL key cannot be mapped as enter... MVS-sysgen/web3270#2

For this, I would recommend noVNC (http://novnc.com/). It took me about 30 minutes to get a copy of x3270 running inside a Linux VNC server, which I could then access from a browser with noVNC.

schoko11 commented 2 years ago

hmm, thanks for this tip, i will give that a try too...

kraabrsg commented 2 years ago

For this, I would recommend noVNC (http://novnc.com/). It took me about 30 minutes to get a copy of x3270 running inside a Linux VNC server, which I could then access from a browser with noVNC.

Hi, could you give more detail on this (we will maybe try it out in the upcoming RHEL Installation, but now i can't try it, because we are on WIN10... Thanks!

kraabrsg commented 2 years ago

I don't see any way to pass the oversize setting to web3270. How are you doing that? Or was this oversize issue only seen when using c3270 or wc3270 directly?

Hi, as of this, i ask a sysadmin and he said that it should be 3278, screen format max. So i tried varios combinations with it (WC3270, with an oversize parameter also specified)

wc3270.model IBM-3278-5 wc3270.model IBM-3278-5-E wc3270.model IBM-3279-5 wc3270.model IBM-3279-5-E but according to https://x3270.miraheze.org/wiki/Oversize_resource

a screensize of 160x62 can not be set, because it execeeds 4096.

Another question regarding keymaps... we have set "right alt + pos1" to jump between selected "sessions" (tso , cics, control-d) in the "MAI Primary Menu" is this possible too? (maybe with X3270 then, for tryouts i will use WC3270). Especially the "POS1" could be tricky(a "VKEY")? https://x3270.miraheze.org/wiki/3270_models#syntax

Thanks!

pmattes commented 2 years ago

The oversize documentation on the Wiki is wrong -- the limit is 0x3fff (16383) rows times columns maximum. I have corrected it. 162 columns and 62 rows is fine with wc3270, as long as it fits on your screen.

I have also corrected the Wiki pages that describe the model resource and model names. The model names do not include the 'IBM-' part. So if you want a 3278 model 5, the correct model name is '3278-5-E'. I am glad to see you are using the Wiki, and I apologize for the inaccuracies.

I don't quite understand your question about 'right alt + pos1'. Can you clarify?

schoko11 commented 2 years ago

Well the "right alt" is labelled "ALT GR" (at least on austria/german keyboard layouts) the "+" means both keys must pressed at the same time.

Will try both the " corrected" model and the oversize parameter..

Can you give me more details on how you setup X3270 with NOVNC ? thanks!

pmattes commented 2 years ago

Here is a simple package to run x3270 under noVNC: http://x3270.bgp.nu/download/specials/x3270-novnc.tgz There is a basic README there. I can fill in more customization details if you like.

I know about the AltGr key. But I don't understand what 'pos1' is, or what the 'MAI Primary Menu' is. Luckily, you can turn on tracing in c3270, wc3270, x3270 and wx3270 to see exactly what keystroke events each is receiving when you press a particular key or combination of keys.

schoko11 commented 2 years ago

well Mai primary menu can be seen partly in https://github.com/pmattes/x3270/issues/24#issuecomment-1012980538

(access to control-d, tso, operator console service, cics -> with the "jump" key you can switch beween these started "sessions")

POS1 is also a key..., but i don't get why would i trace it? I need to find out how to map this "jump" key -> tracing the wrong key combination would not help here.. (instead tracing what persom sends would be a better approach?).

Thanks for your efforts, highly appreciated!

pmattes commented 2 years ago

POS1 is also a key..., but i don't get why would i trace it? I need to find out how to map this "jump" key -> tracing the wrong key combination would not help here.. (instead tracing what persom sends would be a better approach?).

I'm still lost, then. What is it exactly that you want the emulator to do, when the user does exactly what? Please assume I am an idiot. ;-)

kraabrsg commented 2 years ago

Well ;-) i give it another try...

grafik

i hit F7 to get to the MAI Menu:

grafik

With "ALTGR + POS1" i switch through the selected "sessions" (one after one)

When no session is "active / selected" it puts out this warning, saying "cannot jump" -> hence i mentioned "jump" assuming that this is fairly standard 3270 / 3278 thing...

grafik

pmattes commented 2 years ago

Aha! I am learning things all the time.

The 'POS1' key on a German keyboard is the 'Home' key on an English keyboard. And (as far as I can tell) the PCOMM mapping for Alt-Home (Alt-POS1) is the 3270 PA2 key.

JUMP is not a standard 3270 terminal thing. It may be a standard thing on your mainframe (or on some front end attached to your mainframe), but this is the first I've heard of it. And apparently PA2 is the way to toggle through the options in it.

Per https://x3270.miraheze.org/wiki/PA()_action, PA2 is mapped to Alt-2 on x3270, wc3270 and wx3270, and is mapped to the two-key sequence (Ctrl-a, 2) on c3270. If you prefer Alt-Home/Alt-POS1, you can set up a mapping for that in x3270, wc3270 or wx3270, but not in c3270, which does not allow mapping of modifiers with Home/POS1.

kraabrsg commented 2 years ago

Hi, "ALT + 2" is working like expected, but i can't trace the file to somehow set the keys accordingly.. wc3270.hostname: L:Y:MYHOST:0000 wc3270.model 3278-5 wc3270.oversize 160x62 wc3270.codePage: cp1141 wc3270.autoShortcut: true wc3270.verifyHostCert: true wc3270.trace: true wc3270.traceDir: C:\\Temp

I installed the noinstall version, in this directory there is also the *.wc3270 file (noticed there is also a folder "wc3270" in the Documents folder....)

Show(Keymap) gives

[base:2] Alt <Key>2: PA(2)

I also still can't get rid of the screen size mismatch error (tried "3278-5-E" and "3278-5" and "3278-4" alongside with oversize)

Thanks!

pmattes commented 2 years ago

I hope those aren't the literal settings you are using, since there are missing ':' characters and they need to be on multiple lines.

Yes, wc3270 stores its session files in a folder called 'wc3270' under Documents. But it can run them from anywhere. There are no .wc3270 files in the noinstall zipfile, so I don't know where something like that would have come from.

You can also try 3278-2-E and 3278-3-E and see if your host likes those. (You definitely want the '-E', and it has nothing to do with screen size, so it should be safe.)

schoko11 commented 2 years ago

oh yes! the ":" are missing such a dumb error (the settings are on seperated lines) :-(

Thanks!

kraabrsg commented 2 years ago

Well finally found out that i should use the shorcut, otherwise the settings are not applied... (i also used the wizard to configure) :-) Thanks!

kraabrsg commented 2 years ago

Here is a simple package to run x3270 under noVNC: http://x3270.bgp.nu/download/specials/x3270-novnc.tgz There is a basic README there. I can fill in more customization details if you like.

I know about the AltGr key. But I don't understand what 'pos1' is, or what the 'MAI Primary Menu' is. Luckily, you can turn on tracing in c3270, wc3270, x3270 and wx3270 to see exactly what keystroke events each is receiving when you press a particular key or combination of keys.

Hi, as of your post, i would like to try that out. Our Linux is RHEL 8.

As for now i commented out all everything about fonts. On our system is xset not installed (we don't have a display manager installed, just the bash). so i commented out "Wait for the server to be awake" (just left in some waiting time) and "Set up the fonts"

but at line Popen(['x3270', 'novnc.x3270'])

assumes that x3270 is installed (it is not included in the script) -> how do i install X3270 so that this call works? Has it to be compiled for our RHEL installation ?

Thanks!

pmattes commented 2 years ago

Without xset, you're going to end up with some ugly fonts, but that's a lesser problem.

Yes, the script assumes that you have x3270 installed on your system. There are RedHat packages for x3270 that you can install (unfortunately they are quite old versions, but they should work), or you can compile it from source. I don't have a RedHat system set up at the moment, so I can't provide a binary for you easily.

kraabrsg commented 2 years ago

Hi, thanks for the info, i just gave it a try and installed it with yum. It is version 3.6ga5. Just wondering how to start. And where it is installed... "which x3270" gives /usr/bin/which: no x3270 in (/opt/cdunix/ndm/bin:/home/<myuser>/.local/bin:/home/<myuser>/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/bin/) In the description there is stated "you will also need to install a frontend for x3270. " Because wie don't have a X Window system we need to install "x3270-text" ? is this correct ? how will this look like? (wondering also where x3270 is installed, fairly new to redhat)... Thanks!