DTTERM(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

DtTerm β€” DtTerm widget class πŸ’…

Okay bestie, this is the DtTerm(library call) manual β€” and it is literally the blueprint for the DtTerm widget class. Main character terminal-emulator energy, no cap. ✨


πŸ’– NAME πŸ’–

DtTerm β€” DtTerm widget class πŸŽ€


✨ SYNOPSIS ✨

#include &<Dt/Term.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

The DtTerm widget gives you the core set of functionality you need to emulate an ANSI X3.64-1979– and ISO 6429:1992(E)-style terminal, like the DEC VT220. Think of it as the whole terminal glow-up package: text rendering, scrolling, margin and tab support, escape sequence parsing, and the low-level OS-specific interface required to allocate and configure a pty or STREAMS pseudo-terminal device and write the system's utmp device. It's giving "I contain multitudes," honestly. πŸ’…

πŸ‘‘ Classes πŸ‘‘

The DtTerm widget inherits behavior and resources from the Core and XmPrimitive classes.

  • The class pointer is dtTermWidgetClass.
  • The class name is DtTerm.

πŸŽ€ New Resources πŸŽ€

The following table defines a set of widget resources used by the application to specify data. The application can also set the resource values for the inherited classes to set attributes for this widget.

To reference a resource by name or by class in a .Xdefaults file, the application must remove the DtN or DtC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, the application must remove the Dt prefix and use the remaining letters β€” in either lower case or upper case, but including any underscores between words. 🫢

The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).

🌈 DtTerm Resource Set, Part 1 of 2 🌈

  • DtNallowSendEvents β€” class DtCAllowSendEvents; type Boolean; default False; access CSG.
  • DtNappCursorDefault β€” class DtCAppCursorDefault; type Boolean; default False; access CSG.
  • DtNappKeypadDefault β€” class DtCAppKeypadDefault; type Boolean; default False; access CSG.
  • DtNautoWrap β€” class DtCAutoWrap; type Boolean; default True; access CSG.
  • DtNbackgroundIsSelect β€” class DtCBackgroundIsSelect; type Boolean; default False; access CG.
  • DtNbaseHeight β€” class DtCBaseHeight; type int; default 0; access G.
  • DtNbaseWidth β€” class DtCBaseWidth; type int; default 0; access G.
  • DtNblinkRate β€” class DtCBlinkRate; type int; default 250; access CSG.
  • DtNc132 β€” class DtCC132; type Boolean; default False; access CSG.
  • DtNcharCursorStyle β€” class DtCCharCursorStyle; type unsigned char; default DtTERM_CHAR_CURSOR_BOX; access CSG.

🌟 DtTerm Resource Set, Part 2 of 2 🌟

  • DtNcolumns β€” class DtCColumns; type short; default 80; access CSG.
  • DtNconsoleMode β€” class DtCConsoleMode; type Boolean; default False; access CG.
  • DtNemulationID β€” class DtCEmulationID; type String; default DtTermWidget; access CSG.
  • DtNheightInc β€” class DtCHeightInc; type int; default 0; access G.
  • DtNinputVerifyCallback β€” class DtCCallback; type XtCallbackList; default NULL; access C.
  • DtNjumpScroll β€” class DtCJumpScroll; type Boolean; default True; access CSG.
  • DtNkshMode β€” class DtCKshMode; type Boolean; default False; access CSG.
  • DtNlogging β€” class DtCLogging; type Boolean; default False; access CSG.
  • DtNmapOnOutput β€” class DtCMapOnOutput; type Boolean; default False; access CSG.
  • DtNmapOnOutputDelay β€” class DtCMapOnOutputDelay; type int; default 0; access CSG.
  • DtNmarginBell β€” class DtCMarginBell; type Boolean; default False; access CSG.
  • DtNmarginHeight β€” class DtCMarginHeight; type Dimension; default 2; access CSG.
  • DtNmarginWidth β€” class DtCMarginWidth; type Dimension; default 2; access CSG.
  • DtNnMarginBell β€” class DtCNMarginBell; type int; default 10; access CSG.
  • DtNoutputLogCallback β€” class DtCCallback; type XtCallbackList; default NULL; access C.
  • DtNpointerBlank β€” class DtCPointerBlank; type Boolean; default False; access CSG.
  • DtNpointerBlankDelay β€” class DtCPointerBlankDelay; type int; default 2; access CSG.
  • DtNpointerColor β€” class DtCForeground; type String; default dynamic; access CSG.
  • DtNpointerColorBackground β€” class DtCBackground; type String; default dynamic; access CSG.
  • DtNpointerShape β€” class DtCPointerShape; type String; default xterm; access CSG.
  • DtNreverseWrap β€” class DtCReverseWrap; type Boolean; default False; access CSG.
  • DtNrows β€” class DtCRows; type short; default 24; access CSG.
  • DtNsaveLines β€” class DtCSaveLines; type string; default 4s; access CG.
  • DtNshadowType β€” class DtCShadowType; type unsigned char; default DtSHADOW_IN; access CSG.
  • DtNstatusChangeCallback β€” class DtCCallback; type XtCallbackList; default NULL; access C.
  • DtNsubprocessArgv β€” class DtCSubprocessArgv; type String *; default NULL; access CG.
  • DtNsubprocessCmd β€” class DtCSubprocessCmd; type String; default NULL; access CG.
  • DtNsubprocessExec β€” class DtCSubprocessExec; type Boolean; default True; access CSG.
  • DtNsubprocessLoginShell β€” class DtCSubprocessLoginShell; type Boolean; default False; access CG.
  • DtNsubprocessPid β€” class DtCSubprocessPid; type int; default -1; access G.
  • DtNsubprocessTerminationCallback β€” class DtCCallback; type XtCallbackList; default NULL; access C.
  • DtNsubprocessTerminationCatch β€” class DtCSubprocessTerminationCatch; type Boolean; default True; access CSG.
  • DtNsunFunctionKeys β€” class DtCSunFunctionKeys; type Boolean; default False; access CSG.
  • DtNtermDevice β€” class DtCTermDevice; type int; default -1; access CG.
  • DtNtermDeviceAllocate β€” class DtCTermDeviceAllocate; type Boolean; default True; access CG.
  • DtNtermId β€” class DtCTermId; type String; default vt220; access CSG.
  • DtNtermName β€” class DtCTermName; type String; default dtterm; access CSG.
  • DtNtermSlaveName β€” class DtCTermSlaveName; type String; default NULL; access CG.
  • DtNttyModes β€” class DtCTtyModes; type String; default NULL; access CSG.
  • DtNuserBoldFont β€” class DtCUserBoldFont; type XmFontList; default dynamic; access CSG.
  • DtNuserFont β€” class DtCUserFont; type XmFontList; default dynamic; access CSG.
  • DtNverticalScrollBar β€” class DtCVerticalScrollBar; type Widget; default NULL; access CSG.
  • DtNvisualBell β€” class DtCVisualBell; type Boolean; default False; access CSG.
  • DtNwidthInc β€” class DtCWidthInc; type int; default 0; access G.

Okay, now the resource-by-resource tea. β˜•βœ¨

  • allowSendEvents β€” Specifies that the terminal emulator allow synthetic events (generated and sent by another application). Enabling this resource opens up a possible security hole.
⚠️ Bestie, that security-hole line is not a drill. Enabling allowSendEvents opens up a possible security hole.
  • appCursorDefault β€” Specifies the initial cursor mode. If True, the cursor keys are initially in application mode. If False, the cursor keys are initially in cursor mode.
  • appKeypadDefault β€” Specifies the initial keypad mode. If True, the keypad keys are initially in application mode. If False, the keypad keys are initially in numeric mode.
  • c132 β€” Specifies whether or not the DECCOLM escape sequence that switches between a 132- and 80-column window is honored.
  • consoleMode β€” Specifies that output directed at /dev/console be directed instead to the terminal window. It is provided as a way to prevent output that would normally be displayed on the internal terminal emulator (ITE) from overwriting the X server's display. It is not provided as a general mechanism to direct the output from an arbitrary system's /dev/console to an arbitrary X server. Ownership of, and read-write permission for, /dev/console is required to redirect console output. 🫢
  • DtNautoWrap β€” Specifies whether or not auto-wrap is initially enabled.
  • DtNbackgroundIsSelect β€” Controls the background color. When False, the background color is the color specified. When True, the background color is the select color corresponding to the background and is constant with other Motif-based applications.
  • DtNbaseHeight β€” Specifies the terminal window's base height. With this resource the application computes its base height for the shell widget, which then allows the window manager to provide appropriate sizing feedback to the user. The height of the terminal window is:
DtNbaseHeight + DtNrows Γ— DtNheightInc
  • DtNbaseWidth β€” Specifies the terminal window's base width. With this resource the application computes its base width for the shell widget, which then allows the window manager to provide appropriate sizing feedback to the user. The width of the terminal window is:
DtNbaseWidth + DtNcolumns Γ— DtNwidthInc
  • DtNblinkRate β€” Specifies the number of milliseconds the cursor is in the on and off states while blinking. A value of 250 blinks the cursor two times per second. A value of zero turns blinking off.
  • DtNc132 β€” This resource specifies whether or not the DECCOLM escape sequence should be honored.
  • DtNcharCursorStyle β€” Specifies the text cursor shape. A DtTERM_CHAR_CURSOR_BOX value specifies a cursor the width and height of the base font's bounding box. A DtTERM_CHAR_CURSOR_BAR value specifies a cursor the width of the base font's bounding box, two pixels high, and drawn with its top on the baseline. The default is DtTERM_CHAR_CURSOR_BOX.
  • DtNcolumns β€” Specifies the number of text columns in the terminal window. For additional information, see DtNbaseWidth.
  • DtNemulationID β€” Specifies the string to which the TERMINAL_EMULATOR environment variable is set.
  • DtNheightInc β€” sets the character cell height used as the height increment when the widget calculates the size of the terminal window πŸŽ€ for the extra tea, see DtNbaseHeight.
  • DtNinputVerifyCallback β€” a list of callbacks called before the DtTerm widget sends text to the child process πŸ’… that text can come from keyboard input, selection, or drag and drop. The callback gets the address of a DtTermInputVerifyCallbackStruct, and DtCR_TERM_INPUT_VERIFY is the reason set by the callback.
  • DtNjumpScroll β€” tells the DtTerm widget to use jump scrolling πŸ”₯ under jump scrolling the screen may scroll more than one line at a time, which means faster screen updates when multiple lines of text get sent to the terminal. The max number of lines that can jump-scroll is limited to the number of lines in the terminal window, and the DtTerm widget guarantees all lines are displayed.
  • DtNkshMode β€” enables ksh mode 🐚 with ksh mode, a key pressed with the extend modifier bit set generates an escape character followed by the character generated by the unextended keystroke. This option exists for use with emacs(1) and the emacs command-line editor mode of ksh(1). It conflicts with the normal meta key use for generating extended single byte characters and for generating multi-byte Asian characters.
  • DtNmapOnOutput β€” says the terminal widget should map (de-iconify) itself upon subprocess output if it is unmapped (iconified) ✨ you can set an initial period where it does not map itself via DtNmapOnOutputDelay.
  • DtNmapOnOutputDelay β€” number of seconds after start-up that the widget does not honor DtNmapOnOutput πŸ•°οΈ this lets initial output (like shell prompts) go to the terminal without auto-mapping the window. Default is zero (no delay).
  • DtNmarginBell β€” whether or not the bell rings when the user types near the right margin πŸ”” the distance from the right margin is specified by the nMarginBell resource.
  • DtNmarginHeight β€” height of the margin between the text and the top and bottom of the DtTerm widget’s window.
  • DtNmarginWidth β€” width of the margin between the text and both sides of the DtTerm widget’s window.
  • DtNnMarginBell β€” number of characters from the right margin at which the margin bell rings when it’s enabled via DtNmarginBell 🎐.
  • DtNoutputLogCallback β€” list of callbacks called when the widget receives text from the child process πŸ’– DtTermOutputLogCallbackStruct is the structure type whose address is passed to this callback, and DtCR_TERM_OUTPUT_LOG is the reason set by the callback.
  • DtNpointerBlank β€” says the pointer cursor is in blanking mode πŸ–±οΈ in this mode the cursor turns on when the pointer moves, and blanks either after a selectable number of seconds or after keyboard input. The delay is set via DtNpointerBlankDelay.
  • DtNpointerBlankDelay β€” number of seconds to wait after the pointer stops moving before blanking it (see DtNpointerBlank) ⏳ a value of zero prevents the pointer from blanking until a key is pressed.
  • DtNpointerColor β€” foreground color the DtTerm widget uses for the terminal window’s pointer (X11 cursor) 🎨 default is the terminal window’s foreground color.
  • DtNpointerColorBackground β€” background color the DtTerm widget uses for the terminal window’s pointer (X11 cursor) 🎨 default is the terminal window’s background color.
  • DtNpointerShape β€” X cursor font character the DtTerm widget uses as the pointer cursor πŸ‘† it should be a string from the include file X11/cursorfont.h, with the leading XC_ removed. Default is xterm(1).
  • DtNreverseWrap β€” whether or not reverse-wraparound is enabled πŸ”.
  • DtNrows β€” number of rows of text in the terminal window πŸ“ for more info, see DtNbaseHeight.
  • DtNsaveLines β€” number of lines in the terminal buffer beyond the length of the window πŸ—‚οΈ the value is a number followed by an optional suffix. No suffix or suffix l (ell) means total buffer length is the number plus the length of the terminal window. Suffix s means total buffer length is (the number plus one) times the length of the terminal window. The DtTerm widget tries to maintain the same buffer-to-window ratio when the window is resized larger.
  • DtNshadowType β€” type of shadow drawn around the terminal window 🌫️ see the XmFrame(3) widget for supported shadow types.
  • DtNstatusChangeCallback β€” list of callbacks called when the DtTerm widget’s status changes πŸ¦‹ status changes include stuff like cursor position, caps lock state, and insert char state. The callback gets the address of a DtTermStatusChangeCallbackStruct, and DtCR_TERM_STATUS_CHANGE is the reason the callback sends.
  • DtNsubprocessArgv β€” argument list passed to the subprocess if DtNsubprocessExec is True 🧾 if DtNsubprocessCmd is NULL, the first string of this argument is used as the name of the command to execute.
  • DtNsubprocessCmd β€” name of the command to run if DtNsubprocessExec is True βš™οΈ if DtNsubprocessExec is NULL, the first string of the DtNsubprocessArgv argument is used.
  • DtNsubprocessExec β€” whether or not a subprocess is fork(2) and exec(2) πŸš€ if True, a subprocess is launched as specified via the DtNsubprocessArgv resource, if set, or the DtNsubprocessCmd resource, if set, or the SHELL environment variable, if set, or the default system shell.
  • DtNsubprocessloginShell β€” indicates that the starting shell should be a login shell 🐣 that means the first character of argv[0] is a dash, which tells the shell to read the system’s profile and the user’s .profile files (for ksh(1) and sh(1)) or the system’s csh.login and the user’s .login (for csh(1)).
  • DtNsubprocessPid β€” supplies the process ID of the subprocess running in the terminal widget when DtNsubprocessExec is True πŸ†”.
  • DtNsubprocessTerminationCallback β€” list of callbacks called when the subprocess associated with the DtTerm widget exits πŸ’€ the callback gets the address of a DtTermSubprocessTerminationCallbackStruct, and DtCR_TERM_SUBPROCESS_TERMINATION is the reason the callback sends.
  • DtNsubprocessTerminationCatch β€” whether or not the DtTerm widget installs a signal handler to catch the subprocess termination 🚨 if the application installs its own signal handler, the application must catch the subprocess termination and inform the DtTerm widget via the DtTermSubprocReap(3) function.
  • DtNsunFunctionKeys β€” whether or not Sun Function Key escape sequences are generated for function keys instead of standard escape sequences β˜€οΈ.
  • DtNtermDevice β€” file descriptor for the master side of the pty or STREAMS pseudo-terminal device associated with the DtTerm widget πŸ”Œ.
  • DtNtermDeviceAllocate β€” whether or not the DtTerm widget allocates a pty or STREAMS pseudo-terminal device, or uses the pseudo-terminal device passed to it via the DtNtermDevice resource 🧰.
  • DtNtermId β€” name the DtTerm widget uses to select the correct response to terminal ID queries 🏷️ valid values are vt100, vt101, vt102, and vt220.
  • DtNtermName β€” name the DtTerm widget uses in setting the TERM environment variable 🌈 default is dtterm(1).
  • DtNtermSlaveName β€” name of the slave device of the pty or STREAMS pseudo-terminal device associated with the DtTerm widget 🧚 the widget uses this resource to update the system’s utmp entry associated with the subprocess.
  • DtNttyModes β€” string containing terminal-setting keywords and the characters to which they may be bound πŸ€“ allowable keywords include: intr, quit, erase, kill, eof, eol, swtch, start, stop, brk, susp, dsusp, rprnt, flush, weras, and lnext. The terminal emulator correctly parses and silently ignores keywords that do not apply to a specific architecture. Control characters can be specified as ^char (for example, ^c or ^u), and ^? can be used to indicate delete. This is useful for overriding the default terminal settings without having to do an stty(1) every time a DtTerm widget is created.
  • DtNuserBoldFont β€” supplies the XmFontList the DtTerm widget uses to display bold terminal text πŸ–‹οΈ the terminal emulator supports only character or mono-spaced fonts. When using proportional fonts, the behavior is undefined. The terminal emulator generates a default bold font based on the XLFD name of the userFont. If that font is not available, the terminal emulator generates bold text by overstriking (with a one pixel offset) the userFont.
  • DtNuserFont β€” this is the XmFontList the DtTerm widget uses to actually draw terminal text. πŸ’… Heads up: the terminal emulator supports only character or mono-spaced fonts, and if you roll in with proportional fonts the behavior is undefined. For the default font, it grabs the XmNtextFontList value from the parent bulletin board (see the XmBulletinBoard(3) widget) in the same way the XmText(3) widget does. 🫢
  • DtNverticalScrollBar β€” lets the app hand over its own vertical scroll bar widget, and DtTerm updates it as scrolling happens. Important: the DtTerm widget does not create the scroll bar. You supply it, bestie. πŸŽ€
  • DtNvisualBell β€” says whether the DtTerm widget uses a visible bell (aka flashing) instead of an audible bell when Ctrl+G comes through. πŸ””βœ¨
  • DtNwidthInc β€” the character cell width the DtTerm widget uses as the width increment when it calculates the size of the terminal window. For extra info, see DtNbaseWidth. πŸ“

Inherited Resources 🫢

The DtTerm widget inherits behavior and resources from these named superclasses. For a complete description of each resource, go read that superclass’s man page, okay? πŸ’–

XmPrimitive Resource Set

Each line is name / class / type / default / access so nothing gets lost:

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG.
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG.
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG.
  • XmNhighlightOnEnter β€” class XmCHighlightOnEnter, type Boolean, default False, access CSG.
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG.
  • XmNhighlightThickness β€” class XmCHighlightThickness, type Dimension, default 2, access CSG.
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmNONE, access G.
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 2, access CSG.
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG.
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG.
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG.
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG.
  • XmNuserData β€” class XmCUserData, type Pointer, default NULL, access CSG.

Core Resource Set

  • XmNaccelerators β€” class XmCAccelerators, type XtAccelerators, default NULL, access CSG.
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G.
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG.
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG.
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG.
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG.
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG.
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG.
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access CG.
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG.
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG.
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG.
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default NULL, access CSG.
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG.
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG.
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG.

Callback Information πŸ’–

When callbacks fire for DtNstatusChangeCallback, they get a pointer to a DtTermStatusChangeCallbackStruct callback structure. It includes at least these members, no cap:

  • int reason β€” why the callback was invoked: DtCR_TERM_STATUS_CHANGE.
  • XEvent *event β€” points to the XEvent, if any, that triggered the callback, or NULL. 🫢
  • int cursorX β€” the current text cursor X (column) position. πŸ“
  • int cursorY β€” the current text cursor Y (row) position. πŸ“
  • Boolean capsLock β€” the current state of the caps lock indicator. πŸ” 
  • Boolean stop β€” the current state of subprocess output parsing. Processing output from the subprocess can be turned on and off via the stop action (similar to the XON/XOFF handshake invoked via Ctrl+S/Ctrl+Q). ⏸️
  • DtTermInsertCharMode insertCharMode β€” not used by the DtTerm widget. πŸ™ˆ
  • Boolean locked β€” the current state of the keyboard caps lock. πŸ”’

A pointer to the DtTermSubprocessTerminationCallbackStruct callback structure, which includes at least the following members, is passed to callbacks for DtNsubprocessTerminationCallback:

  • int reason β€” why the callback was invoked: DtCR_TERM_SUBPROCESS_TERMINATION.
  • XEvent *event β€” points to the XEvent, if any, that triggered the callback, or NULL.
  • pid_t pid β€” the process ID of the terminated subprocess.
  • int status β€” the exit status of the terminated subprocess.

A pointer to the DtTermInputVerifyCallbackStruct callback structure, which includes at least the following members, is passed to callbacks for DtNinputVerifyCallback:

  • int reason β€” why the callback was invoked: DtCR_TERM_INPUT_VERIFY.
  • XEvent *event β€” points to the XEvent, if any, that triggered the callback, or NULL.
  • Boolean doit β€” indicates whether the text should be sent to the child process. Setting doit to False negates the action.
  • unsigned char *text β€” points to the text (either single- or multi-byte depending on the locale) to be sent to the child process.
  • int length β€” the number of bytes to be sent to the child process.

A pointer to the DtTermOutputlogVerifyCallbackStruct callback structure, which includes at least the following members, is passed to callbacks for DtNoutputLogCallback:

  • int reason β€” why the callback was invoked: DtCR_TERM_OUTPUT_LOG.
  • XEvent *event β€” points to the XEvent, if any, that triggered the callback, or NULL.
  • unsigned char *text β€” points to the text (either single- or multi-byte depending on the locale) received from the child process.
  • int length β€” the number of bytes received from the child process.

Translations ✨

The DtTerm widget includes translations from XmPrimitive(3). πŸ¦‹

...and yeah, the one thing you absolutely cannot do: altering translations in #override or #augment mode is undefined. Don't do it, bestie. It's giving "playing with fire in a library." πŸ’€


🎹 The Default Key Bindings (a.k.a. the big mood board)

So the table below has two vibes: Key Pressed on the left, Action Routine on the right. Every single one is canon, so here's the full lineup with zero skips ✨

  • Shift ~Ctrl&<Key>KP_Multiply β†’ XtDisplayInstalledAccelerators()
  • ~Shift Ctrl&<Key>KP_Multiply β†’ XtDisplayAccelerators()
  • Shift Ctrl&<Key>KP_Multiply β†’ XtDisplayTranslations()
πŸ’… Yes, that one key does three totally different things depending on which modifiers you're holding. She contains multitudes.
  • &<Key>osfCancel β†’ process-cancel()
  • &<Key>osfCopy β†’ copy-clipboard()
  • &<Key>osfCut β†’ copy-clipboard()
  • &<Key>osfPaste β†’ paste-clipboard()
  • &<Key>osfBeginLine β†’ beginning-of-buffer()
  • &<Key>osfEndLine β†’ end-of-buffer()
  • Shift&<Key>osfUp β†’ scroll(1,line)
  • Shift&<Key>osfDown β†’ scroll(-1,line)
  • &<Key>osfUp β†’ move-cursor(up)
  • &<Key>osfDown β†’ move-cursor(down)
  • &<Key>osfLeft β†’ move-cursor(backward)
  • &<Key>osfRight β†’ move-cursor(forward)

See the pattern? Shift = you're scrolling, no Shift = you're just moving the little cursor around. Cute, right? πŸ¦‹

  • &<Key>Do β†’ vt-edit-key(do)
  • &<Key>Help β†’ vt-edit-key(help)
  • &<Key>Menu β†’ vt-edit-key(menu)
  • &<Key>Find β†’ vt-edit-key(find)
  • &<Key>Insert β†’ vt-edit-key(insert)
  • &<Key>Select β†’ vt-edit-key(select)
  • ~Shift&<Key>osfPageUp β†’ vt-edit-key(prior)
  • ~Shift&<Key>osfPageDown β†’ vt-edit-key(next)
  • &<Key>osfPageUp β†’ scroll(-1,page)
  • &<Key>osfPageDown β†’ scroll(1,page)
🌸 Lowkey obsessed with how osfPageUp means "send a prior edit key" when you're NOT holding Shift, but means "scroll one whole page" when you ARE. Same key, whole different personality.
  • Mod1&<Key>Break β†’ soft-reset()
  • Shift&<Key>Break β†’ hard-reset()
  • ~Shift ~Mod1&<Key>Break β†’ vt-break()
  • Ctrl&<Key>Cancel β†’ stop(long)
  • ~Ctrl&<Key>Cancel β†’ stop()
  • ~Shift&<Key>Tab β†’ tab()

πŸ”’ Keypad keys, all on ~Mod1 (no Mod1 held, bestie)

~Mod1&<Key>KP_Space:            keypad-key-execute(space)
~Mod1&<Key>KP_Tab:              keypad-key-execute(tab)
~Mod1&<Key>KP_Enter:            keypad-key-execute(enter)
~Mod1&<Key>KP_F1:               keypad-key-execute(f1)
~Mod1&<Key>KP_F2:               keypad-key-execute(f2)
~Mod1&<Key>KP_F3:               keypad-key-execute(f3)
~Mod1&<Key>KP_F4:               keypad-key-execute(f4)
~Mod1&<Key>KP_Equal:            keypad-key-execute(equal)
~Mod1&<Key>KP_Multiply:         keypad-key-execute(multiply)
~Mod1&<Key>KP_Add:              keypad-key-execute(add)
~Mod1&<Key>KP_Separator:        keypad-key-execute(separator)
~Mod1&<Key>KP_Subtract:         keypad-key-execute(subtract)
~Mod1&<Key>KP_Decimal:          keypad-key-execute(decimal)
~Mod1&<Key>KP_Divide:           keypad-key-execute(divide)
~Mod1&<Key>KP_0:                keypad-key-execute(0)
~Mod1&<Key>KP_1:                keypad-key-execute(1)
~Mod1&<Key>KP_2:                keypad-key-execute(2)
~Mod1&<Key>KP_3:                keypad-key-execute(3)
~Mod1&<Key>KP_4:                keypad-key-execute(4)
~Mod1&<Key>KP_5:                keypad-key-execute(5)
~Mod1&<Key>KP_6:                keypad-key-execute(6)
~Mod1&<Key>KP_7:                keypad-key-execute(7)
~Mod1&<Key>KP_8:                keypad-key-execute(8)
~Mod1&<Key>KP_9:                keypad-key-execute(9)

Ten out of ten, no notes, every single keypad key accounted for πŸŽ€


πŸ…΅ The F-keys, but make it two whole sets

Shift held = UDK (that's the flavor, iykyk):

Shift&<Key>F1:                  vt-function-key-execute(1, UDK)
Shift&<Key>F2:                  vt-function-key-execute(2, UDK)
Shift&<Key>F3:                  vt-function-key-execute(3, UDK)
Shift&<Key>F4:                  vt-function-key-execute(4, UDK)
Shift&<Key>F5:                  vt-function-key-execute(5, UDK)
Shift&<Key>F6:                  vt-function-key-execute(6, UDK)
Shift&<Key>F7:                  vt-function-key-execute(7, UDK)
Shift&<Key>F8:                  vt-function-key-execute(8, UDK)
Shift&<Key>F9:                  vt-function-key-execute(9, UDK)
Shift&<Key>F10:                 vt-function-key-execute(10, UDK)
Shift&<Key>F11:                 vt-function-key-execute(11, UDK)
Shift&<Key>F12:                 vt-function-key-execute(12, UDK)
Shift&<Key>F13:                 vt-function-key-execute(13, UDK)
Shift&<Key>F14:                 vt-function-key-execute(14, UDK)
Shift&<Key>F15:                 vt-function-key-execute(15, UDK)
Shift&<Key>F16:                 vt-function-key-execute(16, UDK)
Shift&<Key>F17:                 vt-function-key-execute(17, UDK)
Shift&<Key>F18:                 vt-function-key-execute(18, UDK)
Shift&<Key>F19:                 vt-function-key-execute(19, UDK)
Shift&<Key>F20:                 vt-function-key-execute(20, UDK)
Shift&<Key>F21:                 vt-function-key-execute(21, UDK)
Shift&<Key>F22:                 vt-function-key-execute(22, UDK)
Shift&<Key>F23:                 vt-function-key-execute(23, UDK)
Shift&<Key>F24:                 vt-function-key-execute(24, UDK)
Shift&<Key>F25:                 vt-function-key-execute(25, UDK)
Shift&<Key>F26:                 vt-function-key-execute(26, UDK)
Shift&<Key>F27:                 vt-function-key-execute(27, UDK)
Shift&<Key>F28:                 vt-function-key-execute(28, UDK)
Shift&<Key>F29:                 vt-function-key-execute(29, UDK)
Shift&<Key>F30:                 vt-function-key-execute(30, UDK)
Shift&<Key>F31:                 vt-function-key-execute(31, UDK)
Shift&<Key>F32:                 vt-function-key-execute(32, UDK)
Shift&<Key>F33:                 vt-function-key-execute(33, UDK)
Shift&<Key>F34:                 vt-function-key-execute(34, UDK)
Shift&<Key>F35:                 vt-function-key-execute(35, UDK)

No Shift = function (same deal, just the other flavor):

~Shift&<Key>F1:                 vt-function-key-execute(1, function)
~Shift&<Key>F2:                 vt-function-key-execute(2, function)
~Shift&<Key>F3:                 vt-function-key-execute(3, function)
~Shift&<Key>F4:                 vt-function-key-execute(4, function)
~Shift&<Key>F5:                 vt-function-key-execute(5, function)
~Shift&<Key>F6:                 vt-function-key-execute(6, function)
~Shift&<Key>F7:                 vt-function-key-execute(7, function)
~Shift&<Key>F8:                 vt-function-key-execute(8, function)
~Shift&<Key>F9:                 vt-function-key-execute(9, function)
~Shift&<Key>F10:                vt-function-key-execute(10, function)
~Shift&<Key>F11:                vt-function-key-execute(11, function)
~Shift&<Key>F12:                vt-function-key-execute(12, function)
~Shift&<Key>F13:                vt-function-key-execute(13, function)
~Shift&<Key>F14:                vt-function-key-execute(14, function)
~Shift&<Key>F15:                vt-function-key-execute(15, function)
~Shift&<Key>F16:                vt-function-key-execute(16, function)
~Shift&<Key>F17:                vt-function-key-execute(17, function)
~Shift&<Key>F18:                vt-function-key-execute(18, function)
~Shift&<Key>F19:                vt-function-key-execute(19, function)
~Shift&<Key>F20:                vt-function-key-execute(20, function)
~Shift&<Key>F21:                vt-function-key-execute(21, function)
~Shift&<Key>F22:                vt-function-key-execute(22, function)
~Shift&<Key>F23:                vt-function-key-execute(23, function)
~Shift&<Key>F24:                vt-function-key-execute(24, function)
~Shift&<Key>F25:                vt-function-key-execute(25, function)
~Shift&<Key>F26:                vt-function-key-execute(26, function)
~Shift&<Key>F27:                vt-function-key-execute(27, function)
~Shift&<Key>F28:                vt-function-key-execute(28, function)
~Shift&<Key>F29:                vt-function-key-execute(29, function)
~Shift&<Key>F30:                vt-function-key-execute(30, function)
~Shift&<Key>F31:                vt-function-key-execute(31, function)
~Shift&<Key>F32:                vt-function-key-execute(32, function)
~Shift&<Key>F33:                vt-function-key-execute(33, function)
~Shift&<Key>F34:                vt-function-key-execute(34, function)
~Shift&<Key>F35:                vt-function-key-execute(35, function)

Thirty-five keys, twice. She ate and left no crumbs πŸ”₯


πŸ–±οΈ Keys, releases, mouse buttons, window events

  • &<KeyRelease> β†’ key-release()
  • &<KeyPress> β†’ insert()
  • ~Shift~Ctrl&<Btn1Down> β†’ grab-focus()
  • Shift~Ctrl&<Btn1Down> β†’ extend-start()
  • ~Ctrl&<Btn1Motion> β†’ select-adjust()
  • ~Ctrl&<Btn1Up> β†’ extend-end()
  • ~Shift&<Btn2Down> β†’ process-bdrag()
  • ~Shift&<Btn2Up> β†’ copy-to()
  • &<EnterWindow> β†’ enter()
  • &<LeaveWindow> β†’ leave()
  • &<FocusIn> β†’ focus-in()
  • &<FocusOut> β†’ focus-out()

And then, crowned at the end of the whole translation spec:

tgroup dispwid="7.49in"

That's the whole blessed list, no cap ✨


πŸŽ€ Action Routines πŸŽ€

Okay so now the good part β€” here's what those action routines actually do. The DtTerm widget supports all of these, bestie:

  • bell([percentage]) β€” rings the keyboard bell at the specified percentage above or below the base volume. πŸ›ŽοΈ Yes, there's a volume knob. There's always a volume knob.
  • break() β€” sends an RS232 break signal to the child process.
  • cancel() β€” sends a CAN (cancel) character to the child process. 😌 Politely telling it "never mind."
  • copy-clipboard() β€” copies current selection to the clipboard. The most iconic duo: copy and clipboard.
  • copy-to() β€” sends the primary selection to the subprocess.
  • do() β€” sends the escape sequence (see dtterm(5)) associated with the Do key to the child process.
  • edit-key( string) β€” sends the escape sequence (see dtterm(5)) associated with the corresponding edit key to the child process. The interpretation of these keys is application-specific β€” so like, the widget ships the sequence, the app decides the lore. πŸ“œ Valid values for string are:
    • find
    • insert
    • next
    • prior
    • remove
    • select
  • extend-start() β€” kicks off extending whatever text you've currently got selected πŸ’… how much gets extended depends on how many times you clicked the mouse (peep grab-focus for the deets).
  • extend-end() β€” extends the current selection. Same vibe: the amount of text depends on your click count (again, see grab-focus).
  • function-key-execute(num[, type]) β€” yeets the escape sequence (check dtterm(5)) for function key num over to the child process. Valid num values are 1 to 35, inclusive, no cap. If type is function (or honestly not set at all, default behaviour slay), the escape sequence for function key num goes to the child process. If type is UDK, then the string tied to user defined key num gets sent instead. πŸŽ€
  • grab-focus() β€” does one of these depending on how many times you clicked, it's giving click-count main character energy:
    • one click πŸ‘‰ deselects any selected text and drops the selection anchor at the pointer position
    • two clicks πŸ‘‰ selects a word
    • three clicks πŸ‘‰ selects a line of text
    • four clicks πŸ‘‰ selects all text, periodt
  • hard-reset() β€” does a hard reset on the terminal emulator. For what "hard reset" actually means, see dtterm(5). No cap. πŸ”₯
  • help() β€” sends the escape sequence (see dtterm(5)) associated with the DEC VT220 Help key to the child process. The interpretation of this key is application-specific, iykyk.
  • keymap(name) β€” defines a brand new translation table whose resource name is name with the suffix Keymap tacked on (case is significant, don't play with it πŸ’€). The name None restores the original translation table, iconic.
  • keypad-key-execute(string) β€” sends the escape sequence (see dtterm(5)) for the corresponding keypad key to the child process. The interpretation of these keys is application-specific. Valid values for string are literally:
    • f1 - f4
    • space
    • tab
    • enter
    • equal
    • multiply
    • add
    • separator
    • subtract
    • decimal
    • divide
    • 0 - 9
  • move-cursor(direction) β€” sends the escape sequence (see dtterm(5)) for the corresponding cursor motion to the child process. Interpretation of these keys is application-specific. Valid values for direction are:
    • up
    • down
    • backward
    • forward
  • paste-clipboard() β€” sends the contents of the clipboard to the subprocess. Fresh off the clipboard, bestie. πŸ’–
  • process-bdrag() β€” the result of this one is determined by several factors, it's a whole situation: position of the location cursor, motion of the location cursor, and the interval between a BTransfer release. Okay so:
    • This action sends the current selection to the subprocess if text is selected, the location cursor is disjoint from the current selection, and no motion is detected within a given time interval.
    • The action drags the current selection if the location cursor is positioned on the selection, the time interval is exceeded, and movement of the location cursor is detected. This action creates a DragContext object whose XmNexportTargets resource value includes target types of COMPOUND_TEXT, STRING and TEXT. πŸ¦‹
  • redraw-display() β€” redraws the contents of the text window. Refresh era. ✨
  • scroll(count[, units]) β€” scrolls the display memory down if count is greater than zero, or up if count is less than zero. The number of lines scrolled is based on count and units. The default for units is line. Valid values for units are:
    • page
    • halfpage
    • line
  • select-adjust() β€” extends the selection. Amount of text selected depends on your mouse click count: one click selects characters; two clicks selects words; three clicks selects lines; and four clicks selects the entire buffer. All of it. Respect. πŸ‘‘
  • select-all() β€” selects all text. That's it. That's the action. πŸ’œ
  • select-page() β€” selects all text currently displayed on the screen.
  • self-insert() β€” sends the character associated with the key pressed to the child process.
  • soft-reset() β€” performs a soft reset of the terminal. For what "soft reset" means, see the ``Reset'' section in dtterm(5).
  • stop(state) β€” toggles, starts, or stops the whole process of reading data from the child process. Valid values for state are:
    • toggle
    • on
    • off
  • string(string) β€” inserts the specified text string as if it had been typed. The string must be quoted if it contains white space or non-alphanumeric characters. Also, the string is interpreted as a hexadecimal character constant if it begins with the characters 0x. πŸ‘€
  • tab() β€” sends a tab to the child process. Slay, spacing.
  • visual-bell() β€” flashes the window quickly. Blink blink, notice me. πŸŽ€

πŸ’« Virtual Bindings πŸ’«

The bindings for virtual keys are vendor-specific, so like, ask your vendor bestie. Also important: virtual bindings do not apply when the DtTerm widget has input focus. For info about bindings for virtual buttons and keys, see VirtualBindings(3).


🌸 On-the-Spot Preedit Style and Behavior 🌸

When the user selects the on-the-spot input method style, preedit strings are displayed right there in the dtterm window. To commit a preedit string, the user can choose from a number of generic actions, including cut, paste, cursor movement, and commit key. Iconic lineup, honestly.

In addition to the generic actions, several of the DtTerm action routines may cause committal. These action routines include move_cursor, process_bdrag, and string. The action routines correspond to the generic commit actions.

When the preedit buffer is active, it may be highlighted. This highlight value can be set by the input method server. Since there is only a single highlight mode available in DtTerm, the following XIMFeedbacks will set the highlight:

  • XIMPrimary
  • XIMSecondary
  • XIMTertiary

πŸ‘€ SEE ALSO πŸ‘€

dtterm(1), Dt/Term.h - DtTerm(5), DtTermInitialize(3), DtTermDisplaySend(3), DtTermSubprocSend(3), DtTermSubprocReap(3), dtterm(5), pty(7), XtSetValues(1), XtGetValues(1), XmFrame(3), XmPrimitive(3), XmFontList(3), XmBulletinBoard(3), XmText(3), VirtualBindings(3), Core(3).


And that's the whole page bestie, we ate and left no crumbs 🫢 this one's from the DtTerm(library call) docs β€” that's the source/version stamped on it, with its date riding along in the footer. Go forth and bind your actions, ily, bye! πŸ’…βœ¨

πŸ“¦ where this page comes from