PtTty

PtTty — A terminal that is attached to a device.

Synopsis

class PtTty PtTerminal
{
    tty_buflen;         // unsigned short  (Pt_ARG_TTY_BUFLEN)    
    tty_cmd;            // string  (Pt_ARG_TTY_CMD)    
    tty_devsize;        // PhPoint  (Pt_ARG_TTY_DEVSIZE)    
    tty_exit_status;    // integer  (Pt_ARG_TTY_EXIT_STATUS)    
    tty_fd;             // integer  (Pt_ARG_TTY_FD)    
    tty_fdset;          // unsigned short  (Pt_ARG_TTY_FDSET)    
    tty_flags;          // flag  (Pt_ARG_TTY_FLAGS)    
    tty_input;          // string  (Pt_ARG_TTY_INPUT)    
    tty_mfd;            // integer  (Pt_ARG_TTY_MFD)    
    tty_path;           // string  (Pt_ARG_TTY_PATH)    
    tty_pid;            // long  (Pt_ARG_TTY_PID)    
    tty_pri;            // integer  (Pt_ARG_TTY_PRI)    
    tty_pseudo;         // string  (Pt_ARG_TTY_PSEUDO)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtTerminal <-- PtTty

Description

This widget is a child of PtTerminal, but can be attached to a device, and has the capability of device I/O.

[Note]

For detailed information, please refer to PtTty in the Photon documentation.

Instance Variables

tty_buflen

A number specifying the length of a buffer for reading data from the device. Default is 1024.

tty_cmd

A write-only string used to spawn a user's log-in shell on the device. Default is nil.

tty_devsize

A PhPoint specifying the size (in rows and columns) of the current device, which may be different from the size of the widget. Default is:

{PhPoint (x . 0) (y . 0)} 
tty_exit_status

A number specifying the exit status of a spawned process.

tty_fd

A number that specifies a file descriptor to which the widget gets attached. The default, -1, breaks the attachment, or indicates no attachment.

tty_fdset

A number that acts as a bitmask to define file descriptors for new processes. The default, 7, makes available descriptors 0, 1, and 2.

tty_flags

This instance variable controls sizing and other characteristics, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_TTY_TERMRESIZESets the terminal widget size when the device size changes.
Pt_TTY_DEVRESIZEResizes the device when the terminal size changes.
Pt_TTY_DEVLIMITResizes the device when its size changes beyond the size limits of the terminal.
Pt_TTY_DEVFORCEResizes the device size to the terminal's size.
Pt_TTY_SETENVSet or modify environment variables.
Pt_TTY_ARGV0Use the program name as argv[0].
Pt_TTY_BUF_PRIVATEThe widget is using an allocated buffer.

tty_input

A string comprising the input to be written.

tty_mfd

The "master" file descriptor, which is a number equal to the tty_fd, or else to the file descriptor of the pty if tty_pseudo was used to open the device.

tty_path

A string specifying a pathname for a reading and writing to a device. Default is nil.

tty_pid

A number specifying the process ID of the process spawned on the device. Default is 0.

tty_pri

A number specifying Photon pulse priority. Default is -1.

tty_pseudo

A string specifying the name of an unused pseudo-tty device to attach to. The default, nil, specifies that //0/dev be used. An empty string "" specifies that /dev be used.

Callbacks

The following callbacks are associated with this widget:

CallbackDescription
Pt_CB_TTY_DEVSIZEThis callback is generated when a resize event is received, but before the terminal widget is resized.
Pt_CB_TTY_OUTPUTThis callback is generated when output is received, before passing it on to the terminal widget.
Pt_CB_TTY_TERMINATEDThis callback is generated when a child process (terminal) has been terminated.

Associated Classes

PtTtyOutput, PtTerminalSizeChange, PtCallbackInfo