3270 TerminalNative 3270 terminal view for VS Code and Cursor. Hosts live in the left activity bar; sessions open as editor tabs with a fixed 3270 grid (not a VT terminal). The TN3270 protocol is handled by IBM tnz in a Python sidecar. tnz and ebcdic are packaged inside the extension, so there is nothing to pip install. Prerequisites
Both are pure Python, so one Setup
Press F5 (Run Extension) from this folder, or install the folder as an unpacked extension. Open the 3270 Terminal icon in the activity bar → Add Host → Connect. Host profilesAdd Host, or Edit Host from a host's context menu, opens a settings tab with
every field on one page. Ctrl+S saves. Profiles are stored in
Passwords are not stored. Log on in the 3270 screen. Screen size
If the size is too small, the host writes past the end of the buffer and tnz drops the session. The reported address is the first one past the end, so it is only a lower bound and raising the size one model at a time will keep failing. SessionsEach connected host gets a tab. Closing it disconnects; connecting again from the sidebar reopens it. A session tab left open across a window reload comes back and reconnects itself, so a 3270 tab survives Developer: Reload Window the way an editor does — it does not resume the host session, it logs on again. One profile can have several tabs at once. New Session on the host, from the
A host with more than one session becomes a branch in the sidebar, with a row per session showing its state. Clicking one brings its tab forward, and each has its own Reconnect and Disconnect. The commands on the host row above work on the host as a whole: Connect revives every idle tab it has, and Disconnect asks which session to drop, or all of them. 3270 Terminal: Reconnect Session in the palette acts on the tab in front of you. The one thing that does not multiply is a pinned LU: a profile with an LU name can only be in session once, and the host refuses the second attempt. Leave the LU blank on profiles you want several sessions of, or duplicate the profile and give each copy its own LU. All sessions share one Python sidecar process. If it stops, the open tabs say
Keys (3270 tab focused)
Every binding can be changed with the See docs/KEYMAP.md for the chord syntax, every action name, and the keys that are reserved. The webview scales the font so the whole 3270 screen fits. Resizing the editor does not change rows×cols. Selection and copy
Either way Ctrl+C copies and Ctrl+V pastes, and copying clears the mark. Ctrl+C with nothing marked is still ATTN. Non-display fields (passwords) read as blanks in both modes, so they can never be copied. Shift+arrows mark a rectangle without touching the mouse, anchored where the 3270
cursor is, and Escape drops it. The cursor itself stays put and nothing goes to
the host, so copying never loses your place in a field. This works in both modes:
Right-click offers Copy, Cut, Paste and Mark all. This is the view's own menu rather than VS Code's, whose Cut/Copy/Paste entries are wired to a text selection and an editable target and so do nothing on a 3270 screen. Cut (Ctrl+X, or the menu) copies the marked rectangle and then blanks the parts of it you could have typed over: input fields are cleared and marked as changed, while protected text — everything the application wrote — is left alone, since a terminal cannot delete that. It needs a marked rectangle, so Ctrl+X does nothing with a stream selection or with nothing marked, and it is refused outright while the keyboard is locked rather than clearing half the block. Nothing is sent to the host until you press ENTER or a PF key, as with any other typing. The wheelA 3270 has no scrollback and the screen always fits the panel, so the wheel sends PF7 and PF8 instead — the keys that page in ISPF — as Vista and PCOMM do. The cursor moves to the cell under the pointer first, so a split screen scrolls the half you are pointing at, and nothing is sent while the host holds the keyboard, so a fast spin cannot overshoot. A sideways tilt wheel is off until you set Hotspots
Only protected fields are treated this way. Applications write their function-key
legends into protected fields and everything you type goes into unprotected ones,
so a click in an entry field always just moves the cursor.
The cursor, the rule line and the bell
Capturing and logging3270 Terminal: Capture Screen writes the screen as it stands to a text file.
Start or Stop Session Log keeps writing every screen until you stop it, each
with a timestamp, size and cursor position; the tab title shows A screen is recorded once it has stood still for a moment, so typing a command
leaves one entry rather than one per keystroke. Both write to
Macros3270 Terminal: Run Macro, or a keymap chord A profile's Logon macro runs by itself after connecting, once the host has drawn a screen that is unlocked and has stopped changing — not the moment the socket is up, when there is nothing yet to type into. It gives up after thirty seconds rather than typing into whatever finally appears. A script macro suits it best, since it can wait for the screen it expects and prompt for the password rather than storing one. See docs/MACROS.md for tape markers, the script API, and examples. File transfer3270 Terminal: Download File from Host and Upload File to Host, or the buttons on the session tab, transfer files with IND$FILE. The session must be at a ready prompt (TSO READY, ISPF option 6, CMS) because the command is typed at the cursor. Text transfers use Whether options need a parenthesis depends on the host, so the File transfer
section of the host settings tab can pin the syntax, the default options and the
idle timeout per profile. That matters as soon as you reach both TSO and VM
systems, since one workspace setting cannot be right for both. Leave the fields
empty to follow the See docs/TRANSFER.md for host file name formats, RECFM and LRECL options, timeouts, and what the failure messages mean. ColourBasic colours come from the field attribute (protected/intensified). When the host
sends extended colour orders, tnz switches the screen into extended colour mode and
the full seven-colour palette plus reverse video and underscore are used. The status
line shows The Appearance section of the host settings tab controls this:
Font
The Font box in the Appearance section of the host settings tab overrides that for one profile, so a single host can look different. Leave the box empty to follow the setting; the placeholder shows which font that currently is. Type a font name, or a comma-separated list, and the preview below the palette shows it. Saving repaints any open session for that host immediately, and changing the setting repaints every session that has not overridden it. With neither set you get the built-in stack of Lucida Console, Cascadia Mono, Consolas and Courier New. The Font box suggests the monospaced fonts installed on your machine. The names
come from the installed font families on Windows, Click the box to see the list, or type to filter it; arrow keys and Enter pick a row, and each row is drawn in its own font. It is a suggestion list, not a restriction, so a name that is not offered can still be typed. They are family names, not face names, which matters for fonts with many
weights. Windows lists the Light face of SauceCodePro Nerd Font Mono as
The built-in stack is always appended to whatever you name, so a font the machine does not have falls back to a monospace rather than to something proportional. The editor also warns when the font you typed does not appear to be installed, since the fallback is otherwise silent. It must be a monospaced font. Columns sit on a fixed pitch measured from the character width, so a proportional font leaves the grid ragged and the cursor in the wrong place. The size is not configurable: it grows to make the full 80 (or however many) columns fill the panel, so resize the pane or drag the tab out to a bigger window to get bigger text. SettingsEvery Settings used to be Builds
The display name in Layout
Apache-2.0. See |