richterm

"terminal emulator" with support for text fonts and images for plan9
git clone git://nsmpr.xyz/richterm.git
Log | Files | Refs | README

commit ad4c82fcbc74324a9c3121e0b62d93eb53813f87
parent 1c19f2d4f38a65604282d34368db449480776480
Author: Pavel Renev <an2qzavok@gmail.com>
Date:   Tue, 22 Mar 2022 21:51:24 +0000

prepare for merger

Diffstat:
MREADME.md | 60++++++++++++++++++++++++++++++++++++------------------------
MTODO | 5++---
Mrichterm.c | 2--
3 files changed, 38 insertions(+), 29 deletions(-)

diff --git a/README.md b/README.md @@ -1,35 +1,47 @@ # Richterm -Richterm is a textual interface with support for different fonts, links, -images and customizable menu. +Richterm is a textual interface with support for links, different fonts, +and customizable menu. # Interface Processes can interact with richterm either by writing and reading to -/dev/cons, or by working with its file system, mounted over at -/mnt/richterm. +`/dev/cons`, or by working with its file system, mounted over at +`/mnt/richterm`. -Reading from /new file will return id of freshly created element. +`/cons` is provided for backwards-compatibilty, text written here +will appear on screen as one would expect. -/ctl will return events, such as menu hits or link follows, and will -accept commands to 'clear' the screen or 'remove $id ...'. +`/text` expects specially formatted text to present on screen. -Lines written to menu file will appear in the right-click menu. +`/ctl` will return events, such as menu hits or link follows. -Directory /$id will contain files representing element's properties -(text, link, image, font). +Content of `/menu` file will appear in the right-click menu. -# Usage +# Format -Richterm runs rc shell by default. You can type text on keyboard -mostly like usual and it will be send to stdin of running process. +`/text` is parsed on line-by-line basis, with first character +being treated as command and rest as argument. + +## Commands + +- '.' - print text +- 'n' - print new line +- 't' - print tab +- 's' - print space +- 'l' - set link +- 'f' - set font -Left mouse button is used to select text. +For 'n', 't', and 's' argument is ignored and should be empty. +For 'l' and'f' empty argument will unset the parameter. -Middle-click opens menu for text operations such as snarf, paste and plumb. +# Usage + +Richterm runs `rc` shell by default. You can type text on keyboard +mostly like usual and it will be send to stdin of running process. Right-click menu combines link operations (Follow, Snarf, Plumb) -and user menu managed by /mnt/richterm/menu file. +and user menu managed by `/menu` file. # Extra @@ -37,20 +49,21 @@ Handler is a rc script that handles richterm's link and menu events. It tries to open links in appropriate programs or sends them to plumber. -For now, two programs are provided: Dir and Markdown: +For now, two programs are provided: Dir and Gopher: Dir prints direcrory listing, supplied with appropriate link for every line. -Markown reads text files and applies markdown formatting to them +Gopher prints gopher menus and text files from supplied gopher URL. -In addition, Handler manages primitive link history via user menu. +In addition, Handler manages primitive link history via 'Back' option in +user menu. # Installation The usual `mk install` invocation will install richterm binary -into /$cputype/bin directory and extra binaries and scripts into -/sys/lib/richterm/bin/... directories +into `/$cputype/bin directory` and extra binaries and scripts into +`/sys/lib/richterm/bin/...` directories -/sys/lib/richterm/bin/... will be bound over /bin by richterm -automatically. -\ No newline at end of file +`/sys/lib/richterm/bin/...` will be bound over `/bin` by richterm +automatically. diff --git a/TODO b/TODO @@ -1,9 +1,7 @@ % g 'TODO' -Rename Objects to Elements. - Rename array to slice. Rethink color palette. -Rewrite drawing to use absolute coords for page.r and cursor pos +Text selection and accessories. +\ No newline at end of file diff --git a/richterm.c b/richterm.c @@ -240,8 +240,6 @@ threadmain(int argc, char **argv) euser->count = strlen(euser->str); free(R); } else if (kv == '\n') { - - // TODO: send str as array to consc channel Array *msg = arraycreate(sizeof(char), 0, nil); if (euser->str != nil) { arraygrow(msg, strlen(euser->str), euser->str);