Modify Mosh to support changing charset to "special characters"
A related (open) issue in Mosh upstream: https://github.com/mobile-shell/mosh/issues/1155
There is an ANSI escape sequence \033(0
, which switches a terminal charset into the "special characters" charset. This then provides box-drawing and other shape characters via ordinary letters. A terminal charset is ordinarily ASCII (?), which can be set via sequence \033(B
.
As an example, echo -e "\033(0lqqqk\ntqqqu\nx x\nmqqqj\033(B"
will produce:
┌───┐
├───┤
│ │
└───┘
Mosh seemingly does not support this special characters charset and the documentation suggests setting the environment variable NCURSES_NO_UTF8_ACS
to 1. The ncurses documentation (https://invisible-island.net/ncurses/man/ncurses.3x.html) describes this environment variable as instructing ncurses to use unicode characters for this purpose instead.
Downstream consumers of go-mosh (inc. nosshtradamus) assumes UTF-8 compatible client terminals, so if Mosh were to translate the special characters charset into the UTF-8 characters itself, non-invasive compatibility improves.
Such a patch might also be accepted by the Mosh upstream. Otherwise, a lightweight fork of Mosh can be maintained for this project.