CK Core CDE
CK Core CDE

Terminal improvements

Escape-sequence strings reserve space for a complete multibyte character and their terminating NUL. The softkey parser stores its full length without 8-bit wrap, checks hex digits and accepts only complete byte pairs. Excess numeric parameters are ignored after the first sixteen, preserving the stored values and keeping all parameter indices within bounds. The parser regression covers UTF-8 boundary cases, 512 hex digits and long excess-parameter sequences.

CK Core CDE makes the Terminal easier to use with files and across repeated sessions.

When dtterm is installed setuid root (the build does this when no utmp helper library is available), it gives up root for good in the child process before it starts the shell. Each step of that change is checked, the resulting real and effective identities are verified and root must not be recoverable; if any of that fails, the terminal stops with a message instead of running the shell with root privileges. The same applies when the window process returns to the user's effective identity after a privileged operation. make -C lib/DtTerm check runs a test with a fake kernel for these cases.

The effective identity is lowered first thing in main(), before the toolkit reads resource files or search paths named by the environment, before the locale is set and before the X connection and its authority file are opened. To check an installation, run the setuid dtterm under strace -f -u <user> -e trace=openat,setresuid with XENVIRONMENT naming a file only root can read: the first setresuid must come before the open, and the open must fail with EACCES. make -C programs/dtterm check runs a guard that main() lowers the identity before it touches the environment.

Drop files into the shell

Dropping one or more files into a Terminal inserts their paths at the input cursor. Spaces, quotes and backslashes are shell-escaped, and multiple paths are separated so the resulting command line remains editable.

Keep the chosen font size

The Options → Font Size choice is stored in ~/.dt/dttermrc and becomes the default for later terminals and clones. A font size restored explicitly by a saved session still takes precedence.

CDE Terminal Options menu with persistent font-size choices

The live Terminal font-size menu in the uConsole session.

Reliable UTF-8 rendering across XFontSet and XFontStruct fallbacks

In multibyte and UTF-8 locales (MB_CUR_MAX > 1), DtTerm stores wide characters (wchar_t) in its terminal line buffer. When an application, command-line -fn option, or early-boot fallback before dtsession populates RESOURCE_MANAGER supplies a single-font XmFONT_IS_FONT (XFontStruct) instead of an XmFONT_IS_FONTSET, libDtTerm now promotes the font's XLFD stem to a full XFontSet (ISO8859-1 + ISO10646-1), retains valid XFontSets even when XCreateFontSet reports optional missing legacy charsets in XLC_LOCALE, and converts wchar_t buffers cleanly in FontRenderFunction (XDrawImageString16 for 2-byte ISO10646-1 fonts and 1-byte narrowing for 8-bit ISO8859-1 fonts) so raw UTF-32 zero bytes are never drawn as missing glyph boxes.

The desktop gallery shows the Terminal from the ARM64 smoke session.