1c3270(1) General Commands Manual c3270(1)
2
3
4
6 c3270 - curses-based IBM host access tool
7
9 c3270 [options] [host]
10
11 c3270 [options] session-file.c3270
12
13
15 c3270 opens a telnet connection to an IBM host in a console window. It
16 implements RFCs 2355 (TN3270E), 1576 (TN3270) and 1646 (LU name selec‐
17 tion), and supports IND$FILE file transfer. If the console is capable
18 of displaying colors, then c3270 emulates an IBM 3279. Otherwise, it
19 emulates a 3278.
20
21 The full syntax for host is:
22 [prefix:]...[LUname@]hostname[:port]
23
24 Prepending a P: onto hostname causes the connection to go through the
25 telnet-passthru service rather than directly to the host. See PASSTHRU
26 below.
27
28 Prepending an S: onto hostname removes the "extended data stream"
29 option reported to the host. See -tn below for further information.
30
31 Prepending an N: onto hostname turns off TN3270E support for the ses‐
32 sion.
33
34 Prepending an L: onto hostname causes c3270 to first create an SSL tun‐
35 nel to the host, and then create a TN3270 session inside the tunnel.
36 (This function is supported only if c3270 was built with SSL/TLS sup‐
37 port). Note that TLS-encrypted sessions using the TELNET START-TLS
38 option are negotiated with the host automatically; for these sessions
39 the L: prefix should not be used.
40
41 A specific Logical Unit (LU) name to use may be specified by prepending
42 it to the hostname with an `@'. Multiple LU names to try can be sepa‐
43 rated by commas. An empty LU can be placed in the list with an extra
44 comma. (Note that the LU name is used for different purposes by dif‐
45 ferent kinds of hosts. For example, CICS uses the LU name as the Ter‐
46 minal ID.)
47
48 The hostname may optionally be placed inside square-bracket characters
49 `[' and `]'. This will prevent any colon `:' characters in the host‐
50 name from being interpreted as indicating option prefixes or port num‐
51 bers. This allows numeric IPv6 addresses to be used as hostnames.
52
53 On systems that support the forkpty library call, the hostname may be
54 replaced with -e and a command string. This will cause c3270 to con‐
55 nect to a local child process, such as a shell.
56
57 The port to connect to defaults to telnet. This can be overridden with
58 the -port option, or by appending a port to the hostname with a colon
59 `:'. (For compatability with previous versions of c3270 and with
60 tn3270(1), the port may also be specified as a second, separate argu‐
61 ment.)
62
63
65 c3270 understands the following options:
66
67 -allbold
68 Forces all characters to be displayed in bold. This helps with
69 PC consoles which display non-bold characters in unreadably dim
70 colors. All-bold mode is the default for color displays, but
71 not for monochrome displays.
72
73 -altscreen rowsxcols=init_string
74 Defines the dimensions and escape sequence for the alternate
75 (132-column) screen mode. See SCREEN SIZE SWITCHING, below.
76
77 -cadir directory
78 Specifies a directory containing CA (root) certificates to use
79 when verifying a certificate provided by the host.
80
81 -cafile filename
82 Specifies a PEM-format file containing CA (root) certificates to
83 use when verifying a certificate provided by the host.
84
85 -cbreak
86 Causes c3270 to operate in cbreak mode, instead of raw mode. In
87 cbreak mode, the TTY driver will properly process XOFF and XON
88 characters, which are required by some terminals for proper
89 operation. However, those characters (usually ^S and ^Q), as
90 well as the characters for interrupt, quit, and lnext (usually
91 ^C, ^\ and ^V respectively) will be seen by c3270 only if pre‐
92 ceded by the lnext character. The susp character (usually ^Z)
93 cannot be seen by c3270 at all.
94
95 -certfile filename
96 Specifies a file containing a certificate to provide to the
97 host, if requested. The default file type is PEM.
98
99 -certfiletype type
100 Specifies the type of the certificate file specified by -cert‐
101 file. Type can be pem or asn1.
102
103 -chainfile filename
104 Specifies a certificate chain file in PEM format, containing a
105 certificate to provide to the host if requested, as well as one
106 or more intermediate certificates and the CA certificate used to
107 sign that certificate. If -chainfile is specified, it overrides
108 -certfile.
109
110 -charset name
111 Specifies an EBCDIC host character set.
112
113 -clear toggle
114 Sets the initial value of toggle to false. The list of toggle
115 names is under TOGGLES below.
116
117 -defaultfgbg
118 Causes c3270 to use the terminal's default foreground color
119 instead of the curses color black, and the terminal's default
120 background color instead of the curses color white. This is
121 helpful for emulators such as gnome-terminal whose representa‐
122 tion of a black background is a murky gray, and for emulators
123 configured to use black text on a white background. It is set
124 automatically if the environment variable COLORTERM is set to
125 gnome-terminal. It is available only if c3270 was compiled with
126 a version of ncurses that supports default colors, if the emula‐
127 tor supports default colors, and if the termcap/terminfo entry
128 indicates this capability.
129
130 -defscreen rowsxcols=init_string
131 Defines the dimensions and escape sequence for the default
132 (80-column) screen mode. See SCREEN SIZE SWITCHING, below.
133
134 -devname name
135 Specifies a device name (workstation ID) for RFC 4777 support.
136
137 -hostsfile file
138 Uses file as the hosts file, which allows aliases for host names
139 and scripts to be executed at login. See ibm_hosts(1) for
140 details.
141
142 -im method
143 Specifies the name of the input method to use for multi-byte
144 input. (Supported only when c3270 is compiled with DBCS sup‐
145 port.)
146
147 -keyfile filename
148 Specifies a file containing the private key for the certificate
149 file (specified via -certfile or -chainfile). The default file
150 type is PEM.
151
152 -keyfiletype type
153 Specifies the type of the private key file specified by -key‐
154 file. Type can be pem or asn1.
155
156 -keypasswd type:value
157 Specifies the password for the private key file, if it is
158 encrypted. The argument can be file:filename, specifying that
159 the password is in a file, or string:string, specifying the
160 password on the command-line directly. If the private key file
161 is encrypted and no -keypasswd option is given, the password
162 will be prompted for interactively.
163
164 -keymap name
165 Specifies a keyboard map to be found in the resource
166 c3270.keymap.name or the file name. See KEYMAPS below for
167 details.
168
169 -km name
170 Specifies the local encoding method for multi-byte text. name
171 is an encoding name recognized by the ICU library. (Supported
172 only when c3270 is compiled with DBCS support, and necessary
173 only when c3270 cannot figure it out from the locale.)
174
175 -model name
176 The model of 3270 display to be emulated. The model name is in
177 two parts, either of which may be omitted:
178
179 The first part is the base model, which is either 3278 or 3279.
180 3278 specifies a monochrome (green on black) 3270 display; 3279
181 specifies a color 3270 display.
182
183 The second part is the model number, which specifies the number
184 of rows and columns. Model 4 is the default.
185
186 Model Number Columns Rows
187 ──────────────────────────────
188 2 80 24
189 3 80 32
190 4 80 43
191 5 132 27
192
193 Note: Technically, there is no such 3270 display as a 3279-4 or
194 3279-5, but most hosts seem to work with them anyway.
195
196 The default model for a color display is 3279-4. For a
197 monochrome display, it is 3278-4.
198
199 -mono Prevents c3270 from using color, ignoring any color capabilities
200 reported by the terminal.
201
202 -noprompt
203 Disables command-prompt mode.
204
205 -oversize colsxrows
206 Makes the screen larger than the default for the chosen model
207 number. This option has effect only in combination with
208 extended data stream support (controlled by the "c3270.extended"
209 resource), and only if the host supports the Query Reply
210 structured field. The number of columns multiplied by the
211 number of rows must not exceed 16383 (3fff hex), the limit of
212 14-bit 3270 buffer addressing.
213
214 It can also be specified as auto, which causes c3270 to fill the
215 entire terminal or console window.
216
217 -port n
218 Specifies a different TCP port to connect to. n can be a name
219 from /etc/services like telnet, or a number. This option
220 changes the default port number used for all connections. (The
221 positional parameter affects only the initial connection.)
222
223 -proxy type:host[:port]
224 Causes c3270 to connect via the specified proxy, instead of
225 using a direct connection. The host can be an IP address or
226 hostname. The optional port can be a number or a service name.
227 For a list of supported proxy types, see PROXY below.
228
229 -printerlu luname
230 Causes c3270 to automatically start a pr3287 printer session.
231 If luname is ".", then the printer session will be associated
232 with the interactive terminal session (this requires that the
233 host support TN3270E). Otherwise, the value is used as the
234 explicit LU name to associate with the printer session.
235
236 -reconnect
237 Causes c3270 to automatically reconnect to the host if it ever
238 disconnects. This option has effect only if a hostname is
239 specified on the command line.
240
241 -rv Switches c3270 from a white-on-black display to a black-on-white
242 display.
243
244 -scriptport port
245 Causes c3270 to listen for scripting connections on local TCP
246 port port. Note that this is the only way to do peer scripting
247 on c3270.
248
249 -secure
250 Disables the interactive c3270> prompt. When used, a hostname
251 must be provided on the command line.
252
253 -set toggle
254 Sets the initial value of toggle to true. The list of toggle
255 names is under TOGGLES below.
256
257 -socket
258 Causes the emulator to create a Unix-domain socket when it
259 starts, for use by script processes to send commands to the
260 emulator. The socket is named /tmp/x3sck.process_id. The -p
261 option of x3270if causes it to use this socket, instead of pipes
262 specified by environment variables.
263
264 -tn name
265 Specifies the terminal name to be transmitted over the telnet
266 connection. The default name is IBM-model_name-E, for example,
267 IBM-3279-4-E for a color display, or IBM-3278-4-E for a
268 monochrome display.
269
270 Some hosts are confused by the -E suffix on the terminal name,
271 and will ignore the extra screen area on models 3, 4 and 5.
272 Prepending an s: on the hostname, or setting the
273 "c3270.extended" resource to "false", removes the -E from the
274 terminal name when connecting to such hosts.
275
276 The name can also be specified with the "c3270.termName"
277 resource.
278
279 -trace Turns on data stream and event tracing at startup. The default
280 trace file name is /tmp/x3trc.process_id.
281
282 -tracefile file
283 Specifies a file to save data stream and event traces into. If
284 the name starts with `>>', data will be appended to the file.
285
286 -tracefilesize size
287 Places a limit on the size of a trace file. If this option is
288 not specified, or is specified as 0 or none, the trace file size
289 will be unlimited. The minimum size is 64 Kbytes. The value of
290 size can have a K or M suffix, indicating kilobytes or megabytes
291 respectively. When the trace file reaches the size limit, it
292 will be renamed with a `-' appended and a new file started.
293
294 -user name
295 Specifies the user name for RFC 4777 support.
296
297 -v Display the version and build options for c3270 and exit.
298
299 -verifycert
300 For SSL or SSL/TLS connections, verify the host certificate, and
301 do not allow the connection to complete unless it can be
302 validated.
303
304 -xrm "c3270.resource: value"
305 Sets the value of the named resource to value. Resources
306 control less common c3270 options, and are defined under
307 RESOURCES below.
308
309 These names are also used as the first parameter to the Toggle action.
310
312 If the terminal that c3270 is running on has at least one more row that
313 the 3270 model requires (e.g., 25 rows for a model 2), c3270 will
314 display a status line. The c3270 status line contains a variety of
315 information. From left to right, the fields are:
316
317 comm status
318 The first symbol is always a 4. If c3270 is in TN3270E mode,
319 the second symbol is a B; otherwise it is an A. If c3270 is in
320 SSCP-LU mode, the third symbol is an S. Otherwise it is blank.
321
322 keyboard lock
323 If the keyboard is locked, an "X" symbol and a message field
324 indicate the reason for the keyboard lock.
325
326 typeahead
327 The letter "T" indicates that one or more keystrokes are in the
328 typeahead buffer.
329
330 temporary keymap
331 The letter "K" indicates that a temporary keymap is in effect.
332
333 reverse
334 The letter "R" indicates that the keyboard is in reverse field
335 entry mode.
336
337 insert mode
338 The letter "I" indicates that the keyboard is in insert mode.
339
340 printer session
341 The letter "P" indicates that a pr3287 session is active.
342
343 secure connection
344 A green letter "S" indicates that the connection is secured via
345 SSL/TLS.
346
347 LU name
348 The LU name associated with the session, if there is one.
349
350 cursor position
351 The cursor row and column are optionally displayed, separated by
352 a "/".
353
354
356 Here is a complete list of basic c3270 actions. Script-specific
357 actions are described on the x3270-script(1) manual page.
358
359 Actions marked with an asterisk (*) may block, sending data to the host
360 and possibly waiting for a response.
361
362 *Attn attention key
363 BackSpace move cursor left (or send
364 ASCII BS)
365 BackTab tab to start of previous input
366 field
367 CircumNot input "^" in NVT mode, or
368 "notsign" in 3270 mode
369 *Clear clear screen
370 Compose next two keys form a special
371 symbol
372 *Connect(host) connect to host
373 *CursorSelect Cursor Select AID
374 Delete delete character under cursor
375 (or send ASCII DEL)
376 DeleteField delete the entire field
377 DeleteWord delete the current or previous
378 word
379 *Disconnect disconnect from host
380 Down move cursor down
381 Dup duplicate field
382 *Enter Enter AID (or send ASCII CR)
383 Erase erase previous character (or
384 send ASCII BS)
385 EraseEOF erase to end of current field
386 EraseInput erase all input fields
387 Escape escape to c3270> prompt
388 Execute(cmd) execute a command in a shell
389 FieldEnd move cursor to end of field
390 FieldMark mark field
391 HexString(hex_digits) insert control-character
392 string
393 Home move cursor to first input
394 field
395 Insert set insert mode
396 *Interrupt send TELNET IP to host
397 Keypad Display pop-up keypad
398 Key(keysym) insert key keysym
399 Key(0xxx) insert key with character code
400 xx
401 Left move cursor left
402 Left2 move cursor left 2 positions
403 Menu Display menu bar
404
405 MonoCase toggle uppercase-only mode
406 MoveCursor(row, col) move cursor to (row,col)
407 Newline move cursor to first field on
408 next line (or send ASCII LF)
409 NextWord move cursor to next word
410 *PA(n) Program Attention AID (n from
411 1 to 3)
412 *PF(n) Program Function AID (n from 1
413 to 24)
414 PreviousWord move cursor to previous word
415 Printer(Start[,lu]|Stop) start or stop printer session
416 PrintText(command) print screen text on printer
417 Quit exit c3270
418 Redraw redraw window
419 Reset reset locked keyboard
420 Right move cursor right
421 Right2 move cursor right 2 positions
422 *Script(command[,arg...]) run a script
423 *String(string) insert string (simple macro
424 facility)
425 *SysReq System Request AID
426 Tab move cursor to next input
427 field
428 Toggle(option[,set|clear]) toggle an option
429 ToggleInsert toggle insert mode
430 ToggleReverse toggle reverse-input mode
431 *Transfer(option=value...) file transfer
432 Up move cursor up
433 ignore do nothing
434
435 Any of the above actions may be entered at the c3270> prompt; these
436 commands are also available for use in keymaps (see KEYMAPS). Command
437 names are case-insensitive. Parameters can be specified with
438 parentheses and commas, e.g.:
439 PF(1)
440 or with spaces, e.g.:
441 PF 1
442 Parameters can be quoted with double-quote characters, to allow spaces,
443 commas, and parentheses to be used.
444
445 c3270 also supports the following interactive commands:
446
447 Help Displays a list of available commands.
448
449 ScreenTrace
450 Turns screen tracing (saving screen images to a file) on or off.
451 The command screentrace on enables screen tracing; the command
452 screentrace off disables it. After on, a filename may be
453 specified to override the default trace file name of
454 /tmp/x3scr.pid.
455
456 Show Displays statistics and settings.
457
458 Trace Turns tracing on or off. The command trace on enables data
459 stream and keyboard event tracing; the command trace off
460 disables it. The qualifier data or keyboard can be specified
461 before on or off to enable or disable a particular trace. After
462 on, a filename may be specified to override the default trace
463 file name of /tmp/x3trc.pid.
464
466 The -keymap option or the c3270.keymap resource allow a custom keymap
467 to be specified. If the option -keymap xxx is given (or the
468 c3270.keymap resource has the value xxx), c3270 will look for a
469 resource named c3270.keymap.xxx. If no resource definition is found,
470 it will look for a file named xxx.
471
472 Multiple keymaps may be specified be separating their names with
473 commas. Definitions in later keymaps supercede those in earlier
474 keymaps.
475
476 In addition, separate keymaps may be defined that apply only in 3270
477 mode or NVT mode. For example, the resource definition
478 c3270.keymap.xxx.nvt or the file xxx.nvt will augment the definition of
479 keymap xxx in NVT mode. Similarly, the resource definition
480 c3270.keymap.xxx.3270 or the file xxx.3270 will augment the definition
481 of keymap xxx in 3270 mode.
482
483 Each line (rule) in a keymap specifies actions to perform when a
484 particular key or sequence of keys is pressed. Keymap rules have the
485 following syntax:
486
487 [Meta][Ctrl]<Key>key...: action[(param[,...])] ...
488
489 Here is a sample keymap definition from a file:
490
491 ! Lines beginning with ! are ignored and can
492 ! occur anywhere.
493 ! Definition of keymap xxx
494 ! When Alt-c is pressed, clear the screen.
495 Alt<Key>c: Clear()
496 ! When PageUp is pressed, send PF7 to the host.
497 <Key>PPAGE: PF(7)
498 ! When Ctrl-a is pressed, then F1, send PF13
499 ! to the host.
500 Ctrl<Key>a <Key>F1: PF(13)
501
502 Here is the same definition as a resource:
503
504 ! Lines beginning with ! are ignored, but NOT
505 ! within a definition.
506 ! Note that the \ is required at the end of the
507 ! first line, and \n\ is
508 ! required at the end of every other line except
509 ! the last.
510 ! Definition of keymap xxx
511 c3270.keymap.xxx: \
512 Alt<Key>c: Clear() \n\
513 <Key>PPAGE: PF(7) \n\
514 Ctrl<Key>A <Key>F1: PF(13)
515
516 The optional Alt or Ctrl modifiers specify that the Alt and Ctrl keys
517 are pressed along with the specified key, respectively. Key is either
518 an ISO 8859-1 symbol name, such as equal for `=' and a for `a', or a
519 symbolic ncurses key name, such as UP. More than one key can be
520 specified, indicating that a sequence of keys must be pressed in order
521 for the rule to be matched. The action is an action from the ACTIONS
522 list above. More than one action may be specified; they will be
523 executed in order.
524
525 Keymap entries are case-sensitive and modifier-specific. This means
526 that a keymap for the b key will match only a lowercase b. Actions for
527 uppercase B, or for Alt-b or Control-B, must be specified separately.
528
529 The base keymap is:
530
531 Key Action
532 ─────────────────────────────────────
533 Ctrl<Key>] Escape
534 Ctrl<Key>a Ctrl<Key>a Key(0x01)
535 Ctrl<Key>a Ctrl<Key>] Key(0x1d)
536 Ctrl<Key>a <Key>Tab BackTab
537 Ctrl<Key>a <Key>c Clear
538 Ctrl<Key>a <Key>e Escape
539 Ctrl<Key>a <Key>r Reset
540 Ctrl<Key>a <Key>k Keypad
541 Ctrl<Key>a <Key>l Redraw
542
543 Ctrl<Key>a <Key>m Compose
544 Ctrl<Key>a <Key>n Menu
545 Ctrl<Key>a <Key>p PrintText
546 Ctrl<Key>a <Key>^ Key(notsign)
547 Ctrl<Key>k Keypad
548 Ctrl<Key>n Menu
549 <Key>UP Up
550 <Key>DOWN Down
551 <Key>LEFT Left
552 <Key>RIGHT Right
553 <Key>F(n) PF(n)
554 Ctrl<Key>a <Key>F(n) PF(n+12)
555 Ctrl<Key>a <Key>1 PA(1)
556 Ctrl<Key>a <Key>2 PA(2)
557 Ctrl<Key>a <Key>3 PA(3)
558
559 The base 3270-mode keymap adds:
560
561 Key Action
562 ──────────────────────────────
563 Ctrl<Key>c Clear
564 Ctrl<Key>d Dup
565 Ctrl<Key>f FieldMark
566 Ctrl<Key>i Tab
567 Ctrl<Key>l Redraw
568 Ctrl<Key>r Reset
569 Ctrl<Key>u DeleteField
570 <Key>BackSpace BackSpace
571 <Key>Return Enter
572 <Key>Tab Tab
573 <Key>Linefeed Newline
574 <Key>BACKSPACE BackSpace
575 <Key>DC Delete
576 <Key>HOME Home
577 <Key>IC ToggleInsert
578
580 Some keyboards do not have a Meta key. Instead, they have an Alt key.
581 Sometimes this key acts as a proper Meta key, that is, it is a modifier
582 key that sets the high-order bit (0x80) in the code that is transmitted
583 for each key. Other keyboards send a two-character sequence when the
584 Alt key is pressed with another key: the Escape character (0x1b),
585 followed by the code for the other key.
586
587 The resource c3270.metaEscape and the termcap km attribute control how
588 c3270 will interpret these sequences. When c3270.metaEscape is set to
589 true, or when c3270.metaEscape is set to auto and the termcap km
590 attribute is set, the keyboard is assumed to have a separate Meta key.
591 The Escape key can be used as an ordinary data key and has no special
592 meaning.
593
594 When c3270.metaEscape is set to true, or when c3270.metaEscape is set
595 to auto and the termcap km attribute is not set, the keyboard is
596 assumed to use the Escape character as a prefix to indicate that the
597 following character is supposed to have the high-order bit set. When
598 c3270 sees an Escape character from the keyboard, it sets a short
599 timeout. If another character arrives before the timeout expires, then
600 c3270 will combine the two characters, setting the high-order bit of
601 the second. In an event trace file, the combined character is listed
602 as derived. In a keymap, only the combined character or the Meta
603 prefix may be used. The Escape key can still be used by itself, but
604 only if there is a short pause before pressing another key.
605
606 The default value for c3270.metaEscape is auto.
607
609 The Transfer action implements IND$FILE file transfer. This action
610 requires that the IND$FILE program be installed on the IBM host, and
611 that the 3270 cursor be located in a field that will accept a TSO or
612 VM/CMS command.
613
614 The Transfer action can be entered at the command prompt with no
615 parameters, which will cause it to prompt interactively for the file
616 names and options. It can also be invoked with parameters to define
617 the entire transfer.
618
619 Because of the complexity and number of options for file transfer, the
620 parameters to the Transfer action take the unique form of option=value,
621 and can appear in any order. Note that if the value contains spaces
622 (such as a VM/CMS file name), then the entire parameter must be quoted,
623 e.g., "HostFile=xxx foo a". The options are:
624
625 Option Required? Default Other Values
626 ────────────────────────────────────────────────────────
627 Direction No receive send
628 HostFile Yes
629 LocalFile Yes
630 Host No tso vm
631 Mode No ascii binary
632 Cr No remove add, keep
633 Remap No yes no
634 Exist No keep replace, append
635 Recfm No fixed, variable,
636 undefined
637 Lrecl No
638 Blksize No
639 Allocation No tracks,
640 cylinders,
641 avblock
642 PrimarySpace No
643 SecondarySpace No
644 BufferSize No 4096
645
646 The option details are as follows.
647
648 Direction
649 send to send a file to the host, receive to receive a file from
650 the host.
651
652 HostFile
653 The name of the file on the host.
654
655 LocalFile
656 The name of the file on the local workstation.
657
658 Host The type of host (which dictates the form of the IND$FILE
659 command): tso (the default) or vm.
660
661 Mode Use ascii (the default) for a text file, which will be
662 translated between EBCDIC and ASCII as necessary. Use binary
663 for non-text files.
664
665 Cr Controls how Newline characters are handled when transferring
666 Mode=ascii files. remove (the default) strips Newline
667 characters in local files before transferring them to the host.
668 add adds Newline characters to each host file record before
669 transferring it to the local workstation. keep preserves
670 Newline characters when transferring a local file to the host.
671
672 Remap Controls text translation for Mode=ascii files. The value yes
673 (the default) causes c3270 to remap the text to ensure maximum
674 compatibility between the workstation's character set and
675 encoding and the host's EBCDIC code page. The value no causes
676 c3270 to pass the text to or from the host as-is, leaving all
677 translation to the IND$FILE program on the host.
678
679 Exist Controls what happens when the destination file already exists.
680 keep (the default) preserves the file, causing the Transfer
681 action to fail. replace overwrites the destination file with
682 the source file. append appends the source file to the
683 destination file.
684
685 Recfm Controls the record format of files created on the host. fixed
686 creates a file with fixed-length records. variable creates a
687 file with variable-length records. undefined creates a file
688 with undefined-length records (TSO hosts only). The Lrecl
689 option controls the record length or maximum record length for
690 Recfm=fixed and Recfm=variable files, respectively.
691
692 Lrecl Specifies the record length (or maximum record length) for files
693 created on the host.
694
695 Blksize
696 Specifies the block size for files created on the host. (TSO
697 hosts only.)
698
699 Allocation
700 Specifies the units for the TSO host PrimarySpace and
701 SecondarySpace options: tracks, cylinders or avblock.
702
703 PrimarySpace
704 Primary allocation for a file created on a TSO host. The units
705 are given by the Allocation option.
706
707 SecondarySpace
708 Secondary allocation for a file created on a TSO host. The
709 units are given by the Allocation option.
710
711 BufferSize
712 Buffer size for DFT-mode transfers. Can range from 256 to
713 32768. Larger values give better performance, but some hosts
714 may not be able to support them.
715
716
718 The PrintText produces screen snapshots in a number of different forms.
719 The default form wth no arguments sends a copy of the screen to the
720 default printer. A single argument is the command to use to print,
721 e.g., lpr. Multiple arguments can include keywords to control the
722 output of PrintText:
723
724 file filename
725 Save the output in a file.
726
727 html Save the output as HTML. This option implies file.
728
729 rtf Save the output as RichText. This option implies file. The
730 font defaults to Courier New and the point size defaults to 8.
731 These can be overridden by the printTextFont and printTextSize
732 resources, respectively.
733
734 string Return the output as a string. This can only be used from
735 scripts.
736
737 modi Render modified fields in italics.
738
739 caption text
740 Add the specified text as a caption above the output. Within
741 text, the special sequence %T% will be replaced with a
742 timestamp.
743
744 command command
745 Directs the output to a command. This allows one or more of the
746 other keywords to be specified, while still sending the output
747 to the printer.
748
749
751 There are several types of script functions available.
752
753 The String Action
754 The simplest method for scripting is provided via the String
755 action. The arguments to String are one or more double-quoted
756 strings which are inserted directly as if typed. The C
757 backslash conventions are honored as follows. (Entries marked *
758 mean that after sending the AID code to the host, c3270 will
759 wait for the host to unlock the keyboard before further
760 processing the string.)
761
762 \b Left
763 \exxxx EBCDIC character in hex
764 \f Clear*
765 \n Enter*
766 \pan PA(n)*
767 \pfnn PF(nn)*
768 \r Newline
769 \t Tab
770 \T BackTab
771 \uxxxx Unicode character in hex
772 \xxxxx Unicode character in hex
773
774 Note that the numeric values for the \e, \u and \x sequences can
775 be abbreviated to 2 digits. Note also that EBCDIC codes greater
776 than 255 and some Unicode character codes represent DBCS
777 characters, which will work only if c3270 is built with DBCS
778 support and the host allows DBCS input in the current field.
779
780 An example keymap entry would be:
781 Meta<Key>p: String("probs clearrdr\n")
782
783 Note: The strings are in ASCII and converted to EBCDIC, so
784 beware of inserting control codes.
785
786 There is also an alternate form of the String action, HexString,
787 which is used to enter non-printing data. The argument to
788 HexString is a string of hexadecimal digits, two per character.
789 A leading 0x or 0X is optional. In 3270 mode, the hexadecimal
790 data represent EBCDIC characters, which are entered into the
791 current field. In NVT mode, the hexadecimal data represent
792 ASCII characters, which are sent directly to the host.
793
794 The Script Action
795 This action causes c3270 to start a child process which can
796 execute c3270 actions. Standard input and output from the child
797 process are piped back to c3270. The Script action is fully
798 documented in x3270-script(1).
799
801 c3270 allows the direct entry of accented letters and special symbols.
802 Pressing and releasing the "Compose" key, followed by two other keys,
803 causes entry of the symbol combining those two keys. For example,
804 "Compose" followed by the "C" key and the "," (comma) key, enters the
805 "C-cedilla" symbol. A C on the status line indicates a pending
806 composite character.
807
808 The mappings between these pairs of ordinary keys and the symbols they
809 represent is controlled by the "c3270.composeMap" resource; it gives
810 the name of the map to use. The maps themselves are named
811 "c3270.composeMap.name". The default is "latin1", which gives mappings
812 for most of the symbols in the ISO 8859-1 Latin-1 character set that
813 are not in the 7-bit ASCII character set.
814
815 Note: The default keymap defines Meta<Key>m as the "Compose" key. You
816 may set up your own "Compose" key with a keymap that maps some other
817 keysym onto the Compose action.
818
820 c3270 supports associated printer sessions via the pr3287(1) program.
821 The Printer action is used to start or stop a pr3287 session.
822
823 The action Printer Start starts a printer session, associated with the
824 current LU. (This works only if the host supports TN3270E.)
825
826 The action Printer Start lu starts a printer session, associated with a
827 specific lu.
828
829 The action Printer Stop stops a printer session.
830
831 The resource c3270.printer.command specifies the command used to print
832 each job; it defaults to lpr. The resource
833 c3270.printer.assocCommandLine specifies the command used to start an
834 associated printer session. It defaults to:
835
836 pr3287 -assoc %L% -command "%C%" %P% %H%
837
838 The resource c3270.printer.luCommandLine specifies the command used to
839 start a specific-LU printer session. It defaults to:
840
841 pr3287 -command "%C%" %R% %P% %L%@%H%
842
843 When the printer session command is run, the following substitutions
844 are made:
845
846 Token Substitition
847 %C% Command (value of
848 c3270.printer.command)
849 %H% Host IP address
850 %L% Current or specified LU
851 %P% Proxy specification
852 %R% Character set
853
854 See pr3287(1) for further details.
855
856 The resource c3270.printerLu controls automatic printer session start-
857 up. If it is set to `.', then whenever a login session is started, a
858 printer session will automatically be started, associated with the
859 login session. If it is set an LU name, then the automatic printer
860 session will be associated with the specified LU.
861
862
864 c3270 supports the Sun telnet-passthru service provided by the
865 in.telnet-gw server. This allows outbound telnet connections through a
866 firewall machine. When a p: is prepended to a hostname, c3270 acts
867 much like the itelnet(1) command. It contacts the machine named
868 internet-gateway at the port defined in /etc/services as telnet-
869 passthru (which defaults to 3514). It then passes the requested
870 hostname and port to the in.telnet-gw server.
871
873 The -proxy option or the c3270.proxy resource causes c3270 to use a
874 proxy server to connect to the host. The syntax of the option or
875 resource is:
876 type:host[:port]
877
878 The supported values for type are:
879
880 Proxy Type Protocol Default Port
881 ──────────────────────────────────────────────
882 http RFC 2817 HTTP 3128
883 tunnel (squid)
884 passthru Sun in.telnet-gw none
885 socks4 SOCKS version 4 1080
886
887
888 socks5 SOCKS version 5 1080
889 (RFC 1928)
890 telnet No protocol (just none
891 send connect host
892 port)
893
894 The special types socks4a and socks5d can also be used to force the
895 proxy server to do the hostname resolution for the SOCKS protocol.
896
898 When running as a 3270 Model 5, c3270 can take advantage of terminals
899 that can switch between 80 and 132 column modes.
900
901 Because the curses library does not support mode switching, the escape
902 sequences and resulting screen dimensions must be specified explicitly
903 to c3270. These are specified with the -altscreen and -defscreen
904 command-line options, or the altScreen and defScreen resources.
905 -altscreen or altScreen defines the alternate (132-column) mode;
906 -defscreen or defScreen defines the default (80-column) mode.
907
908 The syntax for the options and resources is rowsxcols=init_string,
909 where rows and cols give the screen dimensions, and init_string is the
910 escape sequence to transmit to the terminal to enter that mode. For
911 defscreen, the minimum dimensions are 24 rows and 80 columns. For
912 altscreen, the minimum dimensions are 27 rows and 132 columns. Within
913 init_string, the usual escape sequences are supported (\E for escape,
914 \r, \b, etc.). For example, the init string for a 132-column xterm is:
915
916 \E[?40h\E[?3h
917
918 Note: When defscreen and altscreen are specified, the model number is
919 always set to 5.
920
922 Certain c3270 options can be configured via resources. Resources are
923 defined in the file .c3270pro in the user's home directory, and by -xrm
924 options. The definitions are similar to X11 resources, and use a
925 similar syntax. The resources available in c3270 are:
926
927 Resource Default Option Purpose
928 ───────────────────────────────────────────────────────────────────────
929 allBold Auto -allbold Display all
930 characters bold
931 altScreen -altscreen 132-col screen
932 definition
933 blankFill False -set blankFill Blank Fill mode
934 charset bracket -charset EBCDIC character
935 set
936 composeMap latin1 Name of
937 composed-
938 character map
939 cursesColor‐ (note 6) Color mapping
940 ForHostColorn
941 cursesColor‐ green Default color
942 ForDefault mapping
943 cursesColor‐ red Default color
944 ForIntensified mapping
945 cursesColor‐ blue Default color
946 ForProtected mapping
947 cursesColor‐ white Default color
948 ForProtectedIntensified mapping
949 cursesKeymap True Set curses
950 keymap option
951 defScreen -defscreen 80-col screen
952 definition
953 dbcsCgcsgid Override DBCS
954 CGCSGID
955
956
957 dsTrace False -trace Data stream
958 tracing
959 eof ^D NVT-mode EOF
960 character
961 erase ^H NVT-mode erase
962 character
963 extended True Use 3270
964 extended data
965 stream
966 eventTrace False -trace Event tracing
967 hostsFile -hostsfile Host alias/macro
968 file
969 icrnl False Map CR to NL on
970 NVT-mode input
971 inlcr False Map NL to CR in
972 NVT-mode input
973 intr ^C NVT-mode
974 interrupt
975 character
976 keymap -keymap Keyboard map
977 name
978 keymap.foo Definition of
979 keymap foo
980 kill ^U NVT-mode kill
981 character
982 lineWrap False -set lineWrap NVT line wrap
983 mode
984 lnext ^V NVT-mode lnext
985 character
986 m3279 (note 1) -model 3279 (color)
987 emulation
988 metaEscape Auto Interpret ESC-x
989 as Meta-x
990 mono (note 5) -mono Ignore terminal
991 color
992 capabilities
993 monoCase False -set monoCase Mono-case mode
994 noPrompt False -noprompt Disable command-
995 prompt mode
996 numericLock False Lock keyboard
997 for numeric
998 field error
999 oerrLock True Lock keyboard
1000 for input error
1001 oversize -oversize Oversize screen
1002 dimensions
1003 port telnet -port Non-default TCP
1004 port
1005 printer.* (note 4) Printer session
1006 config
1007 printerLu (note 4) Printer session
1008 config
1009 quit ^\ NVT-mode quit
1010 character
1011 reconnect False -reconnect Automatically
1012 reconnect to
1013 host
1014 rprnt ^R NVT-mode reprint
1015 character
1016 sbcsCgcsgid Override SBCS
1017 CGCSGID
1018 secure False Disable
1019 "dangerous"
1020 options
1021 termName (note 2) -tn TELNET terminal
1022 type string
1023 traceDir /tmp Directory for
1024 trace files
1025
1026 traceFile (note 3) -tracefile File for trace
1027 output
1028 typeahead True Allow typeahead
1029 werase ^W NVT-mode word-
1030 erase character
1031
1032 Note 1: m3279 defaults to True if the terminal supports color,
1033 False otherwise. It can be forced to False with the proper
1034 -model option.
1035
1036 Note 2: The default terminal type string is constructed from the
1037 model number, color emulation, and extended data stream modes.
1038 E.g., a model 2 with color emulation and the extended data
1039 stream option would be sent as IBM-3279-2-E. Note also that
1040 when TN3270E mode is used, the terminal type is always sent as
1041 3278, but this does not affect color capabilities.
1042
1043 Note 3: The default trace file is x3trc.pid in the directory
1044 specified by the traceDir resource.
1045
1046 Note 4: See PRINTER SUPPORT for details.
1047
1048
1049 Note 5: mono defaults to false if the terminal supports at least
1050 8 colors and to true otherwise.
1051
1052 Note 6: The default curses color mappings for host colors 0
1053 through 15 are: black, blue, red, magenta, green, cyan, yellow,
1054 white, black, blue, yellow, blue, green, cyan, black and white.
1055
1056
1057 In .c3270pro, lines are continued with a backslash character.
1058
1059 -xrm options override definitions found in .c3270pro. If more than one
1060 -xrm option is given for the same resource, the last one on the command
1061 line is used.
1062
1064 /etc/ibm_hosts
1065 $HOME/.c3270pro
1066
1067
1069 x3270(1), s3270(1), tcl3270(1), ibm_hosts(5), x3270-script(1),
1070 telnet(1), tn3270(1)
1071 Data Stream Programmer's Reference, IBM GA23-0059
1072 Character Set Reference, IBM GA27-3831
1073 RFC 1576, TN3270 Current Practices
1074 RFC 1646, TN3270 Extensions for LUname and Printer Selection
1075 RFC 2355, TN3270 Enhancements
1076
1078 Copyright 1993-2013, Paul Mattes.
1079 Copyright 2004-2005, Don Russell.
1080 Copyright 2004, Dick Altenbern.
1081 Copyright 1990, Jeff Sparkes.
1082 Copyright 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
1083 30332.
1084 All rights reserved.
1085
1086 Redistribution and use in source and binary forms, with or without
1087 modification, are permitted provided that the following conditions are
1088 met:
1089
1090
1091 * Redistributions of source code must retain the above copyright
1092 notice, this list of conditions and the following disclaimer.
1093
1094 * Redistributions in binary form must reproduce the above
1095 copyright notice, this list of conditions and the following
1096 disclaimer in the documentation and/or other materials provided
1097 with the distribution.
1098
1099 * Neither the names of Paul Mattes, Don Russell, Dick Altenbern,
1100 Jeff Sparkes, GTRC nor the names of their contributors may be
1101 used to endorse or promote products derived from this software
1102 without specific prior written permission.
1103
1104
1105 THIS SOFTWARE IS PROVIDED BY PAUL MATTES, DON RUSSELL, DICK ALTENBERN,
1106 JEFF SPARKES AND GTRC "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
1107 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1108 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1109 NO EVENT SHALL PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF SPARKES
1110 OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL
1111 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
1112 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1113 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1114 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
1115 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1116 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1117
1119 c3270 3.3.12ga12
1120
1121
1122
1123 26 February 2013 c3270(1)