DTTERM(3)
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β classDtCAllowSendEvents; typeBoolean; defaultFalse; accessCSG.DtNappCursorDefaultβ classDtCAppCursorDefault; typeBoolean; defaultFalse; accessCSG.DtNappKeypadDefaultβ classDtCAppKeypadDefault; typeBoolean; defaultFalse; accessCSG.DtNautoWrapβ classDtCAutoWrap; typeBoolean; defaultTrue; accessCSG.DtNbackgroundIsSelectβ classDtCBackgroundIsSelect; typeBoolean; defaultFalse; accessCG.DtNbaseHeightβ classDtCBaseHeight; typeint; default0; accessG.DtNbaseWidthβ classDtCBaseWidth; typeint; default0; accessG.DtNblinkRateβ classDtCBlinkRate; typeint; default250; accessCSG.DtNc132β classDtCC132; typeBoolean; defaultFalse; accessCSG.DtNcharCursorStyleβ classDtCCharCursorStyle; typeunsigned char; defaultDtTERM_CHAR_CURSOR_BOX; accessCSG.
π DtTerm Resource Set, Part 2 of 2 π
DtNcolumnsβ classDtCColumns; typeshort; default80; accessCSG.DtNconsoleModeβ classDtCConsoleMode; typeBoolean; defaultFalse; accessCG.DtNemulationIDβ classDtCEmulationID; typeString; defaultDtTermWidget; accessCSG.DtNheightIncβ classDtCHeightInc; typeint; default0; accessG.DtNinputVerifyCallbackβ classDtCCallback; typeXtCallbackList; defaultNULL; accessC.DtNjumpScrollβ classDtCJumpScroll; typeBoolean; defaultTrue; accessCSG.DtNkshModeβ classDtCKshMode; typeBoolean; defaultFalse; accessCSG.DtNloggingβ classDtCLogging; typeBoolean; defaultFalse; accessCSG.DtNmapOnOutputβ classDtCMapOnOutput; typeBoolean; defaultFalse; accessCSG.DtNmapOnOutputDelayβ classDtCMapOnOutputDelay; typeint; default0; accessCSG.DtNmarginBellβ classDtCMarginBell; typeBoolean; defaultFalse; accessCSG.DtNmarginHeightβ classDtCMarginHeight; typeDimension; default2; accessCSG.DtNmarginWidthβ classDtCMarginWidth; typeDimension; default2; accessCSG.DtNnMarginBellβ classDtCNMarginBell; typeint; default10; accessCSG.DtNoutputLogCallbackβ classDtCCallback; typeXtCallbackList; defaultNULL; accessC.DtNpointerBlankβ classDtCPointerBlank; typeBoolean; defaultFalse; accessCSG.DtNpointerBlankDelayβ classDtCPointerBlankDelay; typeint; default2; accessCSG.DtNpointerColorβ classDtCForeground; typeString; defaultdynamic; accessCSG.DtNpointerColorBackgroundβ classDtCBackground; typeString; defaultdynamic; accessCSG.DtNpointerShapeβ classDtCPointerShape; typeString; defaultxterm; accessCSG.DtNreverseWrapβ classDtCReverseWrap; typeBoolean; defaultFalse; accessCSG.DtNrowsβ classDtCRows; typeshort; default24; accessCSG.DtNsaveLinesβ classDtCSaveLines; typestring; default4s; accessCG.DtNshadowTypeβ classDtCShadowType; typeunsigned char; defaultDtSHADOW_IN; accessCSG.DtNstatusChangeCallbackβ classDtCCallback; typeXtCallbackList; defaultNULL; accessC.DtNsubprocessArgvβ classDtCSubprocessArgv; typeString *; defaultNULL; accessCG.DtNsubprocessCmdβ classDtCSubprocessCmd; typeString; defaultNULL; accessCG.DtNsubprocessExecβ classDtCSubprocessExec; typeBoolean; defaultTrue; accessCSG.DtNsubprocessLoginShellβ classDtCSubprocessLoginShell; typeBoolean; defaultFalse; accessCG.DtNsubprocessPidβ classDtCSubprocessPid; typeint; default-1; accessG.DtNsubprocessTerminationCallbackβ classDtCCallback; typeXtCallbackList; defaultNULL; accessC.DtNsubprocessTerminationCatchβ classDtCSubprocessTerminationCatch; typeBoolean; defaultTrue; accessCSG.DtNsunFunctionKeysβ classDtCSunFunctionKeys; typeBoolean; defaultFalse; accessCSG.DtNtermDeviceβ classDtCTermDevice; typeint; default-1; accessCG.DtNtermDeviceAllocateβ classDtCTermDeviceAllocate; typeBoolean; defaultTrue; accessCG.DtNtermIdβ classDtCTermId; typeString; defaultvt220; accessCSG.DtNtermNameβ classDtCTermName; typeString; defaultdtterm; accessCSG.DtNtermSlaveNameβ classDtCTermSlaveName; typeString; defaultNULL; accessCG.DtNttyModesβ classDtCTtyModes; typeString; defaultNULL; accessCSG.DtNuserBoldFontβ classDtCUserBoldFont; typeXmFontList; defaultdynamic; accessCSG.DtNuserFontβ classDtCUserFont; typeXmFontList; defaultdynamic; accessCSG.DtNverticalScrollBarβ classDtCVerticalScrollBar; typeWidget; defaultNULL; accessCSG.DtNvisualBellβ classDtCVisualBell; typeBoolean; defaultFalse; accessCSG.DtNwidthIncβ classDtCWidthInc; typeint; default0; accessG.
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. IfTrue, the cursor keys are initially in application mode. IfFalse, the cursor keys are initially in cursor mode.appKeypadDefaultβ Specifies the initial keypad mode. IfTrue, the keypad keys are initially in application mode. IfFalse, the keypad keys are initially in numeric mode.c132β Specifies whether or not theDECCOLMescape sequence that switches between a 132- and 80-column window is honored.consoleModeβ Specifies that output directed at/dev/consolebe 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/consoleto an arbitrary X server. Ownership of, and read-write permission for,/dev/consoleis required to redirect console output. π«ΆDtNautoWrapβ Specifies whether or not auto-wrap is initially enabled.DtNbackgroundIsSelectβ Controls the background color. WhenFalse, the background color is the color specified. WhenTrue, 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 of250blinks the cursor two times per second. A value of zero turns blinking off.DtNc132β This resource specifies whether or not theDECCOLMescape sequence should be honored.DtNcharCursorStyleβ Specifies the text cursor shape. ADtTERM_CHAR_CURSOR_BOXvalue specifies a cursor the width and height of the base font's bounding box. ADtTERM_CHAR_CURSOR_BARvalue 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 isDtTERM_CHAR_CURSOR_BOX.DtNcolumnsβ Specifies the number of text columns in the terminal window. For additional information, seeDtNbaseWidth.DtNemulationIDβ Specifies the string to which theTERMINAL_EMULATORenvironment 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, seeDtNbaseHeight.DtNinputVerifyCallbackβ a list of callbacks called before theDtTermwidget sends text to the child process π that text can come from keyboard input, selection, or drag and drop. The callback gets the address of aDtTermInputVerifyCallbackStruct, andDtCR_TERM_INPUT_VERIFYis the reason set by the callback.DtNjumpScrollβ tells theDtTermwidget 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 theDtTermwidget 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 withemacs(1)and the emacs command-line editor mode ofksh(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 viaDtNmapOnOutputDelay.DtNmapOnOutputDelayβ number of seconds after start-up that the widget does not honorDtNmapOnOutputπ°οΈ 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 thenMarginBellresource.DtNmarginHeightβ height of the margin between the text and the top and bottom of theDtTermwidgetβs window.DtNmarginWidthβ width of the margin between the text and both sides of theDtTermwidgetβs window.DtNnMarginBellβ number of characters from the right margin at which the margin bell rings when itβs enabled viaDtNmarginBellπ.DtNoutputLogCallbackβ list of callbacks called when the widget receives text from the child process πDtTermOutputLogCallbackStructis the structure type whose address is passed to this callback, andDtCR_TERM_OUTPUT_LOGis 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 viaDtNpointerBlankDelay.DtNpointerBlankDelayβ number of seconds to wait after the pointer stops moving before blanking it (seeDtNpointerBlank) β³ a value of zero prevents the pointer from blanking until a key is pressed.DtNpointerColorβ foreground color theDtTermwidget uses for the terminal windowβs pointer (X11 cursor) π¨ default is the terminal windowβs foreground color.DtNpointerColorBackgroundβ background color theDtTermwidget uses for the terminal windowβs pointer (X11 cursor) π¨ default is the terminal windowβs background color.DtNpointerShapeβ X cursor font character theDtTermwidget uses as the pointer cursor π it should be a string from the include fileX11/cursorfont.h, with the leadingXC_removed. Default isxterm(1).DtNreverseWrapβ whether or not reverse-wraparound is enabled π.DtNrowsβ number of rows of text in the terminal window π for more info, seeDtNbaseHeight.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 suffixl(ell) means total buffer length is the number plus the length of the terminal window. Suffixsmeans total buffer length is (the number plus one) times the length of the terminal window. TheDtTermwidget 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 theXmFrame(3)widget for supported shadow types.DtNstatusChangeCallbackβ list of callbacks called when theDtTermwidgetβs status changes π¦ status changes include stuff like cursor position, caps lock state, and insert char state. The callback gets the address of aDtTermStatusChangeCallbackStruct, andDtCR_TERM_STATUS_CHANGEis the reason the callback sends.DtNsubprocessArgvβ argument list passed to the subprocess ifDtNsubprocessExecis True π§Ύ ifDtNsubprocessCmdis NULL, the first string of this argument is used as the name of the command to execute.DtNsubprocessCmdβ name of the command to run ifDtNsubprocessExecis True βοΈ ifDtNsubprocessExecis NULL, the first string of theDtNsubprocessArgvargument is used.DtNsubprocessExecβ whether or not a subprocess isfork(2)andexec(2)π if True, a subprocess is launched as specified via theDtNsubprocessArgvresource, if set, or theDtNsubprocessCmdresource, if set, or theSHELLenvironment variable, if set, or the default system shell.DtNsubprocessloginShellβ indicates that the starting shell should be a login shell π£ that means the first character ofargv[0]is a dash, which tells the shell to read the systemβs profile and the userβs.profilefiles (forksh(1)andsh(1)) or the systemβscsh.loginand the userβs.login(forcsh(1)).DtNsubprocessPidβ supplies the process ID of the subprocess running in the terminal widget whenDtNsubprocessExecis True π.DtNsubprocessTerminationCallbackβ list of callbacks called when the subprocess associated with theDtTermwidget exits π the callback gets the address of aDtTermSubprocessTerminationCallbackStruct, andDtCR_TERM_SUBPROCESS_TERMINATIONis the reason the callback sends.DtNsubprocessTerminationCatchβ whether or not theDtTermwidget 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 theDtTermwidget via theDtTermSubprocReap(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 theptyorSTREAMSpseudo-terminal device associated with theDtTermwidget π.DtNtermDeviceAllocateβ whether or not theDtTermwidget allocates aptyorSTREAMSpseudo-terminal device, or uses the pseudo-terminal device passed to it via theDtNtermDeviceresource π§°.DtNtermIdβ name theDtTermwidget uses to select the correct response to terminal ID queries π·οΈ valid values arevt100,vt101,vt102, andvt220.DtNtermNameβ name theDtTermwidget uses in setting theTERMenvironment variable π default isdtterm(1).DtNtermSlaveNameβ name of the slave device of theptyorSTREAMSpseudo-terminal device associated with theDtTermwidget π§ the widget uses this resource to update the systemβsutmpentry 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, andlnext. 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,^cor^u), and^?can be used to indicate delete. This is useful for overriding the default terminal settings without having to do anstty(1)every time aDtTermwidget is created.DtNuserBoldFontβ supplies theXmFontListtheDtTermwidget 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 theuserFont. If that font is not available, the terminal emulator generates bold text by overstriking (with a one pixel offset) theuserFont.DtNuserFontβ this is theXmFontListtheDtTermwidget 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 theXmNtextFontListvalue from the parent bulletin board (see theXmBulletinBoard(3)widget) in the same way theXmText(3)widget does. π«ΆDtNverticalScrollBarβ lets the app hand over its own vertical scroll bar widget, andDtTermupdates it as scrolling happens. Important: theDtTermwidget does not create the scroll bar. You supply it, bestie. πDtNvisualBellβ says whether theDtTermwidget uses a visible bell (aka flashing) instead of an audible bell when Ctrl+G comes through. πβ¨DtNwidthIncβ the character cell width theDtTermwidget uses as the width increment when it calculates the size of the terminal window. For extra info, seeDtNbaseWidth. π
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β classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSG.XmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSG.XmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSG.XmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSG.XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSG.XmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default2, accessCSG.XmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessG.XmNshadowThicknessβ classXmCShadowThickness, typeDimension, default2, accessCSG.XmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSG.XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSG.XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSG.XmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSG.XmNuserDataβ classXmCUserData, typePointer, defaultNULL, accessCSG.
Core Resource Set
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultNULL, accessCSG.XmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessG.XmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSG.XmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSG.XmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSG.XmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCG.XmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCG.XmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSG.XmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCG.XmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSG.XmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCG.XmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSG.XmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultNULL, accessCSG.XmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSG.XmNxβ classXmCPosition, typePosition, default0, accessCSG.XmNyβ classXmCPosition, typePosition, default0, accessCSG.
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 theXEvent, if any, that triggered the callback, orNULL. π«Ά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 thestopaction (similar to the XON/XOFF handshake invoked via Ctrl+S/Ctrl+Q). βΈοΈDtTermInsertCharMode insertCharModeβ not used by theDtTermwidget. π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 theXEvent, if any, that triggered the callback, orNULL.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 theXEvent, if any, that triggered the callback, orNULL.Boolean doitβ indicates whether the text should be sent to the child process. SettingdoittoFalsenegates 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 theXEvent, if any, that triggered the callback, orNULL.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 howosfPageUpmeans "send aprioredit 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 (seedtterm(5)) associated with the Do key to the child process.edit-key( string)β sends the escape sequence (seedtterm(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:findinsertnextpriorremoveselect
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 (peepgrab-focusfor the deets).extend-end()β extends the current selection. Same vibe: the amount of text depends on your click count (again, seegrab-focus).function-key-execute(num[,type])β yeets the escape sequence (checkdtterm(5)) for function keynumover to the child process. Validnumvalues are1to35, inclusive, no cap. Iftypeisfunction(or honestly not set at all, default behaviour slay), the escape sequence for function keynumgoes to the child process. IftypeisUDK, then the string tied to user defined keynumgets 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, seedtterm(5). No cap. π₯help()β sends the escape sequence (seedtterm(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 isnamewith the suffixKeymaptacked on (case is significant, don't play with it π). The nameNonerestores the original translation table, iconic.keypad-key-execute(string)β sends the escape sequence (seedtterm(5)) for the corresponding keypad key to the child process. The interpretation of these keys is application-specific. Valid values forstringare literally:f1-f4spacetabenterequalmultiplyaddseparatorsubtractdecimaldivide0-9
move-cursor(direction)β sends the escape sequence (seedtterm(5)) for the corresponding cursor motion to the child process. Interpretation of these keys is application-specific. Valid values fordirectionare:updownbackwardforward
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
DragContextobject whoseXmNexportTargetsresource value includes target types ofCOMPOUND_TEXT,STRINGandTEXT. π¦
redraw-display()β redraws the contents of the text window. Refresh era. β¨scroll(count[,units])β scrolls the display memory down ifcountis greater than zero, or up ifcountis less than zero. The number of lines scrolled is based oncountandunits. The default forunitsisline. Valid values forunitsare:pagehalfpageline
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 indtterm(5).stop(state)β toggles, starts, or stops the whole process of reading data from the child process. Valid values forstateare:toggleonoff
string(string)β inserts the specified text string as if it had been typed. Thestringmust be quoted if it contains white space or non-alphanumeric characters. Also, thestringis interpreted as a hexadecimal character constant if it begins with the characters0x. π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:
XIMPrimaryXIMSecondaryXIMTertiary
π 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
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms