nosh version 1.39

From: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups_at_NTLWorld.COM>
Date: Wed, 23 Jan 2019 04:51:24 +0000

The nosh package is now up to version 1.39 .




I missed announcing 1.38, so this announcement will cover both versions.

These versions see a major addition to the user-space virtual terminal
subsystem, various other changes in several areas, the completion of
some items mentioned as placeholders in version 1.37, and some bug fixes.

Completed placeholders

make-read-only-fs is now fully implemented, and is no longer a placeholder.

More service bundles

There are several more additions to the set of service bundles supplied
with the toolset: connman, ofono, dundee, cntlm, minidlna, powertop,
alsa-state, alsa-restore, unattended-upgrade-shutdown, apt-daily-update,
apt-daily-upgrade, LCDd, phpsessionclean, tinysshd, watchman, rngd,
isnsd, isnsdd, usbmux, and VBoxBalloonCtrl. atd is now a Linux-only
service, with the BSDs now having an atrun service.

More packages

The new nosh-run-bcron, nosh-bcron-as-cron-shims, nosh-debian-crontab,
and nosh-debian-crontab-anacron packages deal in running the services
and providing the data files for various cron toolsets. The former two
deal in bcron, running its services and providing the crontab command as
an alias for bcrontab; and the latter two (only available for Linux
operating systems) deal in Debian's /etc/crontab file.

The new nosh-openrc-shims package contains shims for OpenRC's rc-service
and rc-update commands. And the new nosh-run-via-open-rc package
contains OpenRC scripts for running the service manager.

The new nosh-linux-shims package contains shims for commands to be found
in the non-portable util-linux toolset, such as setterm (more on which

The Debian desktop and server base -run packages no longer preset ntpd
and openntpd, on the grounds that a range of such services exist and
these are not necessarily the installed softwares.

More tools

New commands include getuidgid, userenv-fromenv, setgid-fromenv, envgid,
printenv, setlogin, console-decode-ecma48, console-control-sequence,
console-flat-table-viewer, console-input-method, and

The userenv command is now a combination of two of these new commands,
getuidgid and userenv-fromenv. It has also gained options for not

setlogin sets the login account that is associated with a kernel
session, as returned by the logname command.

printenv is roughly equivalent to the conventional tool of the same
name, except that it is a nosh/exec built-in command and that it
supports several forms of output (including properly quoted rc.conf
form, NUL-terminated form, and envdir form) in addition to the
conventional human-readable form. This built-in command makes a common
idiom easier. When combining clearenv, read-conf/envdir, and printenv
to read a configuration setting, before the advent of the built-in
command one had to employ `command -v printenv` (because clearenv unsets
PATH). Now one can invoke it as simply printenv.

One common use of this idiom is by the toolset's own build system and by
the external configuration import subsystem, to read things like the
amalgamated /etc/system-control/convert/rc.conf and an os_version file.
Further to this, the amalgamated rc.conf now has an os_version setting
on Linux operating systems, consolidating the code for obtaining that in
one place.

console-flat-table-viewer is a full-screen TUI viewer for various sorts
of common flat database tables. It decodes the vis(3) encoding that is
employed in various FreeBSD system tables. It also handles tables that
use the standard ASCII US, RS, GS, and FS characters. File separators
permit a form of continual update and redisplay if used in combination
with pipes.

local-stream-socket-connect is the AF_LOCAL socket equivalent of

Improvements to existing tools and bug fixes

The Z shell completions now function better, and now cover a lot more of
the commands in the toolset.

systemd service unit conversion has been modified to make use of the new
environment commands. The conversion tool in particular makes use of
these when converting per-user Desktop Bus services. The
EnvironmentUser extension has been replaced by an EnviromnentUserOnly
extension, so that User and Group are consistently the sources of the
user account and primary group. Additional settings now supported by
convert-systemd-units include RuntimeDirectoryGroup,
RuntimeDirectoryPreserve, WantsMountsFor, AfterMountsFor, and

convert-systemd-units now also supports %T, %V, and %E expansions and
snippets files.

By analogy to \S, the login-banner command now also recognizes the \N

The external configuration import subsystem now generates per-user
service bundles that import user-wide environment variables from a
${HOME}/config/service-bundles/common pseudo-bundle, allowing users to
maintain a single environment directory that affects all per-user
services. One can thus use rcctl or system-control set-service-env
against this common pseudo-bundle to set environment variables in all
per-user services.

Other improvements to external configuration import include the
automatic generation of service bundles for dbus services, at both the
system-wide and per-user levels.

The N and P actions of console-multiplexor-control when applied to
kernel virtual terminals now work properly.

The external configuration input subsystem now imports defaultrouter
properly from the amalgamated rc.conf.

The cleanX service no longer generates incorrect symbolic links in /tmp.

ttylogin services on user-space virtual terminals were sometimes
(depending from exactly what order things ran in) causing a loop because
of vhangup(). This has been fixed.

And a spelling error in the names of the UNIXREMOTEEUID and
UNIXREMOTEEGID UCSPI-UNIX environment variables has been fixed.

Input methods


Providing a "front-end processor" for running "input methods" has been a
to-do item on the roadmap for a long time. It has always been a goal to
provide more than just U.S.-centric mechanisms in user-space virtual
terminals, and this already ranges from allowing one to use fonts with
large Unicode glyph repertoires through to providing the full ISO 9995-3
common secondary keyboard group. The problems with input method support
were that all of the existing systems that I could tie into required X11
servers, X11 libraries, or direct low-level access to the framebuffer.

Then I discovered OpenVanilla.

The .cin file mechanism is table-based, does not involve plug-ins
needing direct drawing access to the framebuffer, and is common across
that and at least 8 different other tools. It is now common to
user-space virtual terminals, too. Just as one can take a SCO Unix or
FreeBSD kbdmap file and (after conversion) use it with user-space
virtual terminals, one can take other people's existing .cin files and
use them.

Other people have written quite a lot of them, moreover. The blurb page
on Japanese input methods hyperlinked earlier focuses on Japanese, but
there is a wide range of .cin files available from plenty of sources,
from Hangeul Jamo through Array40 to Esperanto.

A new console-input-method command is at the heart of new input method
services, which plumb in to user-space virtual terminals in between the
terminal emulator(s) and the realizer(s). The pre-supplied "head0"
user-space virtual terminal now has an input method service plumbed in.
The nosh Guide documents input method front-end processors. And a new
console-input-method-control command can be used to control them in a
few basic ways.

In line with the philosophy of adopting and adapting existing ideas,
visible from the aforementioned keyboard map and .cin files as well as
the whole building upon the architecture of daemontools notion, the
input method front-end processor provides various control key chords and
function keys that are roughly compatible with other systems, such as
Microsoft's Japanese IME in Windows and the OSF/1 IMLIB. One can, of
course, drive it with the extra keys that are dedicated to the purpose
on a JIS 106/109-key keyboard or a Korean 103/106-key keyboard. There
should be not too much change required to existing typing habits.

Other terminal improvements

In addition to the aforementioned documentation of front-end processors,
the Guide also now documents how "head0" works (although this is just
one way in which one can set up virtual terminals) and has a new chapter
on some of the choices of fonts, keyboard maps, and input methods that
are available from various sources for user-space virtual terminals.

(In a separate project, I have been working on fixes to FreeBSD's
vtfontcvt that permit it to convert Ubuntu Monospace, which as the Guide
documents it currently cannot handle.)


There are new manual entries for TERM(7), linux-vt(4), linux-console(4),
and TerminalCapabilities(3).

No utility other than console-ncurses-realizer uses NCurses and terminfo
any more. They have flaws in how they model real terminals and terminal
emulators. All other TUI tools are built around a different library,
that decodes terminal input using a proper full UTF-8 ECMA-48 state
machine rather than by limited and faulty pattern matching, and that is
geared towards primarily ECMA-48 and ITU T.416 output (with various
common DEC private extensions). This enables better handling of cursor,
editing, and calculator keypad keys with modifiers; full recognition of
"application" and "normal" modes on the cursor and calculator keypads;
full use of 24-bit colour where the terminal supports it; and use of the
DEC Locator or XTerm mouse.

One such is a new realizer, console-termios-realizer, another
realize-a-terminal-on-a-terminal realizer that is more capable than

console-fb-realizer now has better fallback behaviour in the event of
not being supplied a keyboard map, which has been a fairly common
configuration error. It now falls back to the U.S. English
International keyboard map, rather than to an empty one where no keys do

Other improvements lie in extended keys, on the cursor and calculator
keypads. console-terminal-emulator now fully supports individually
switching these two keypads between "application" and "normal" modes,
and fully supports separate control sequences sent by keys for each
mode. To align with this, the "fkey49" to "fkey61" actions in SCO
Unix/FreeBSD keyboard maps have changed in console-convert-kbdmap to
distinguish the cursor keypad from the calculator keypad, and
console-fb-realizer collaborates in ensuring that the terminal
emulator(s) receive as much modifier state information accompanying such
keys as is appropriate.

The keyboard map files themselves now follow a new naming convention.
The external configuration import subsystem will not delete any old
keyboard map files that you might still be using in a running realizer
service, so it is left to you to clean them up. The new naming
convention allows for, say, different "Japanese" maps to be used with a
101/104-key keyboard and a 106/109-key keyboard.

The user-space virtual terminal subsystem now also has the notion of
accelerator key input messages, i.e. alphanumeric key input with the ALT
key modifier. These are recognized by the realizers and the terminal
emulator generates escape sequences for them. Note that these escape
sequences, which are neither ECMA-48 nor DEC VT/SCO standard, conflict
with ECMA-48 7-bit control aliases.

console-decode-ecma48 is a debugging aid for text sent to/from
terminals. It decodes a sequence of ECMA-48 characters, control
characters, escape sequences, and control sequences into a
human-readable representation. It can handle both ECMA-48 output (as
sent to terminals) and ECMA-48 input (as received from terminals), and
recognizes as an extension various common additional control sequences,
such as the control sequences for function keys generated by the SCO
Unix console, and a bunch of DEC VT private control sequences.


console-control-sequence provides a human-readable way of emitting
common ECMA-48, DEC VT, AIXterm, and XTerm control sequences. It is
aliased as setterm and is to a large extent a workalike for the setterm
from the util-linux package, except that it is portable where util-linux
is not. It is both portable to other operating systems, and portable to
other terminals. It does not implement the few things that util-linux
setterm does that are specific to Linux and to Linux's built-in teminal
emulator, but conversely it implements quite a number of standard
ECMA-48 and DEC VT control sequences that the util-linux setterm does
not. These include turning the calculator keypad to/from application
mode; switching to/from the XTerm alternate screen buffer; turning DEC
Locator reports on/off; turning XTerm mouse reports on/off; setting the
cursor shape; changing the mappings of the Delete and Backspace keys;
using the strikethrough, italic, and invisible attributes; turning
background colour erase on/off; setting the underline type; indirect
8-bit colour; direct 24-bit colour; and DEC VT soft reset.

vc-reset-tty and console-resize are now implemented by invoking
console-control-sequence, removing the hardwiring of control sequences
from both.

console-terminal-emulator now recognizes a few additional control
sequences, such as DECST8C (used by console-control-sequence to set
regular tabstops if the interval length is 8). It also has tabstops at
8 column intervals in its reset state. Both the FreeBSD and Linux
kernel virtual terminals do this, even though real DEC VTs do not, so
user-space virtual terminals do too.

The --keep-term option to clearenv now retains a few more
terminal-related environment variables.

This way up

And finally, a feature that you will not want.


Over many years, people have regularly asked for a terminal emulator
where the line progression goes from bottom to top. The idea that they
have is that they will find this easier than top to bottom. In response
to a recent question in the same vein on Stack Exchange, I have given
console-fb-realizer, console-ncurses-realizer, and
console-termio-realizer the ability to realize displays with the line
progression reversed.

Having used this, it seems to me that people only want this because they
have not tried it. Trying it makes a convincing case for not using it.
So I have retained this feature in order that, at long last, there is an
actual terminal system with this feature that people can try, and come
to the same realization. (-:
Received on Wed Jan 23 2019 - 04:51:24 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC