@@ -48,6 +48,10 @@ The older @uref{https://github.com/PerBothner/JWebTerminal,JWebTerminal} project
4848was based on similar concepts, but was mostly written in Java using
4949@uref {https://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm , Javafx WebView }.
5050
51+ There is a mailing list at @email {domterm-discuss @@ domterm.org }
52+ with an @uref {http://lists.domterm.org/listinfo.cgi/domterm-discuss-domterm.org ,information page }
53+ and @uref {http://lists.domterm.org/pipermail/domterm-discuss-domterm.org/ ,archives }.
54+
5155@subheading Recent advances:
5256
5357@itemize
@@ -73,26 +77,12 @@ This uses @uref{http://golden-layout.com/,GoldenLayout}.
7377An experimental @ref {Paging ,pager } with optional
7478automatic pause on each page.
7579@item
76- DomTerm now handles the @code {vttest } terminal test program
77- very well, including BCE (Background Color Erase).
78- @item
7980The preferred ``backend` is now @uref {https://libwebsockets.org/ ,libwebsockets }.
8081This is light-weight, does not require Java, is actively maintained,
8182and enables serving http and the WebSockets on the same port.
8283@item
8384Support for CJK (Chinese, Japanese, and Korean) characters is improved:
8485Double-width characters now really are two columns wide.
85- @item
86- There is now a DomTerm mailing list at @email {domterm-discuss @@ domterm.org }
87- with an @uref {http://lists.domterm.org/listinfo.cgi/domterm-discuss-domterm.org ,information page }
88- and @uref {http://lists.domterm.org/pipermail/domterm-discuss-domterm.org/ ,archives }.
89-
90- @item
91- Optionally uses Google's Closure compiler to reduce the size of the JavaScript.
92-
93- @item
94- The qtdomterm application is designed to replace your favorite
95- standalone terminal emulator program. It uses QtWebEngine.
9686@end itemize
9787
9888@subheading Why another terminal emulator
@@ -152,7 +142,8 @@ This @uref{https://opensource.com/article/18/1/introduction-domterm-terminal-emu
152142@image {images/domterm-2 }
153143A @strong {full-featured terminal emulator }, like @code {xterm }.
154144It is mostly compatible with setting @code {TERM=xterm-256color },
155- as many terminal emulators do.
145+ as many terminal emulators do, and does very well on
146+ the @uref {http://invisible-island.net/vttest/ ,@code {vttest }} terminal test program.
156147Here you see the @code {mc } (Midnight Commander) file browser
157148running in the stand-alone DomTerm application.
158149@ifdocbook
@@ -2531,11 +2522,6 @@ See also the @uref{http://www.ecma-international.org/publications/standards/Ecma
25312522Error recovery and state transitions should follow
25322523@uref {http://www.vt100.net/emu/dec_ansi_parser ,this }.
25332524
2534- @subsubheading Use vttest for testing
2535-
2536- The xterm distribution includes @uref {http://invisible-island.net/vttest/ ,vttest }.
2537- Most of the tests work now, but there are more worth fixing.
2538-
25392525@subsubheading Support Sixel graphics
25402526
25412527@uref {https://en.wikipedia.org/wiki/Sixel ,Sixel } is an old raster
@@ -2548,16 +2534,17 @@ Alternatively, a @code{<canvas>} element could be used.
25482534
25492535@subsubheading Improve copy and paste
25502536
2551- Fix paste in line-editing mode.
2552-
25532537Think about how to do multi-line paste.
25542538
2539+ Copying to HTML should convert @code {<div class='domterm-pre'> } to
2540+ @code {<pre> } so pasting without stylesheets works better.
2541+
25552542@subheading Improve standalone terminal emulator
25562543
25572544Handle saving and truncating scrolled-out output.
25582545
2559- While @code {qtdomterm } supports tabs, moving a tab from from
2560- one window to another window does not work .
2546+ In @code {qtdomterm } consider using @code { QDockWidget } so panes
2547+ can be moved between windows .
25612548
25622549Implement ``drop-down'' mode.
25632550
@@ -2588,6 +2575,8 @@ If DomTerm is integrated in an application with its
25882575own window manager, such as Atom or Visual Studio Code,
25892576it would make sense to instead integrate with the latter manager.
25902577
2578+ Theia and Jupyter use @uref {https://phosphorjs.github.io/ ,PhosphorJS }.
2579+
25912580Similarly, when running under a
25922581@uref {https://en.wikipedia.org/wiki/Tiling_window_manager ,tiling window manager }
25932582using the latter to manage panes and tabs is likely preferable.
@@ -2620,14 +2609,13 @@ Terminal emulators for Atom:
26202609Various Electron @uref {https://github.com/sindresorhus/awesome-electron ,Awesome links }
26212610@uref {https://electron.atom.io/community/ ,Community links }.
26222611
2623- @subheading Keymaps
2612+ @subheading Extend use of keymaps
26242613
2625- We should use a ``keymap'' structure to manage keybindings,
2626- and you should be able add/modify keymaps from the settings.ini.
2627- A small candidate library is
2628- @uref {https://github.com/marijnh/browserkeymap ,browserkeymap }.
2629- It also also worth looking at @uref {https://craig.is/killing/mice ,mousetrap },
2630- though that doesn't have a proper ``keymap'' concept.
2614+ Keybindings for line-edit mode are controlled
2615+ by a keymap data structure
2616+ (based on @uref {https://github.com/marijnh/browserkeymap ,browserkeymap },
2617+ and the defaut bindings can be changed by the serrttngs file.
2618+ This needs to be generalized to other modes.
26312619
26322620@subheading Readline style hooks and improvements
26332621
@@ -2697,44 +2685,58 @@ they should be bundled in a zip archive (like LibreOffice does).
26972685Tools to convert to and from Jupyter format would be nice,
26982686so we should avoid gratuitous conceptual incompatibility.
26992687
2700- @subheading Detachable and remote sessions
2688+ @subheading Detachable sessions
27012689
2702- Detachable sessions means that a front-end
2690+ Detachable sessions (similatr to GNU Screen and tmux) means that a front-end
27032691can disconnect from a session, while the session (child process) persists.
2704- The same or a different front-end can later re-attach to the session
2705-
2706- The GNU Screen and tmux programs support detachable sessions
2707- (along with many other features). These know the display state,
2708- so they can re-create it on a re-attach. The problem is that
2709- DomTerm has more complex state and features, which you won't
2710- be able to use with screen or tmux.
2711-
2712- A simpler solution that only deals with session management is
2713- @uref {http://www.brain-dump.org/projects/abduco/ ,abduco },
2714- or @uref {http://dtach.sourceforge.net ,dtach }. These just ``pass through''
2715- escape sequences, without trying to simulate the display.
2716- The downside is this depends on client re-draw (using
2717- sigwinch or ctrl-L), which is fine for a program like emacs,
2718- but doesn't redraw previous commands, and doesn't work with a
2719- console-based REPL.
2720-
2721- Handling explicit detach can be done by having the front-end serialize
2722- the important aspects of state, and send it back to the back-end.
2723- On a re-attach, the back-end can send the saved front-end state back
2724- to the front-end.
2725-
2726- However, this doesn't handle unexpected detaches, as when the
2727- connection dies. To support this, the back-end has to know the
2728- critical parts of the front-end state. This means the back-end
2729- has to track the front-end state by simulating the actions of
2730- the various escape sections. One way to do that is to use a
2731- @uref {https://github.com/dhamaniasad/HeadlessBrowsers ,``headless'' web browser }
2732- such as (the presumably rekativey heavy-duty) @uref {http://phantomjs.org/ ,PhantomJS }.
2733- Chromium has a @uref {https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md ,@code {--headless } option }.
2734- Using QtWebEngine in headless mode makes sense if we also use qtdomterm.
2692+ The same or a different front-end can later re-attach to the session.
2693+
2694+ DomTerm implements detachable sessions using a combination
2695+ of check-pointing the display state, plus having the backend
2696+ recording output commands since last check-point.
2697+
2698+ This can can handle unexpected detaches, as when a
2699+ connection dies. However, it's a bit heavy-handed:
2700+ check-pointing should only save parts of the state that have changed.
2701+ (This gets a bit tricky when there may be multiple windows displaying
2702+ the same session, combined with not-yet-implemented auto-trunctating of
2703+ old output.)
27352704
27362705See also @uref {https://mosh.org/ ,Mosh } (also @uref {https://lwn.net/Articles/722923/ ,LWN article }), and @uref {https://mistertea.github.io/EternalTCP/ ,EternalTerminal }.
27372706
2707+ @subheading Remote sessions
2708+
2709+ A DomTerm front-end can used used to display
2710+ sessions running on remote backends.
2711+ The challenge is having the remote sessions persist if connection is lost.
2712+ Managing state for a detached session is handled by the domterm backend,
2713+ which therefore needs to run remotely. However, the part that
2714+ manages windows and commands needs to run locally.
2715+
2716+ The solution is to run the backend in proxy mode.
2717+ Supposed the user types:
2718+ @example
2719+ domterm @var {user }@@ @var {host } @var {command }
2720+ @end example
2721+ This can be implemented bying having the (local) backend do:
2722+ @example
2723+ ssh @var {user }@@ @var {host } domterm -- pipe @var {command }
2724+ @end example
2725+ (A password may have to be requested.)
2726+ The @code {--pipe } option is a special kind of window-specifier:
2727+ Instead of output being sent to the browser, it is written to stdout;
2728+ input from stdin is (mostly) sent to the @var {command }.
2729+ (``Mostly'' because the remote domterm processes certain
2730+ escape sequences. For example the @code {"WS" } sequences
2731+ is used to change the pty window size.)
2732+
2733+ The local domterm backend acts as a proxy for the remote backend.
2734+
2735+ It is also useful to be able to connect to a remote backend, directly from
2736+ a browser, without having to install a local @code {domterm } command.
2737+ That requires a remote @code {https } server, and has some more
2738+ permission and security complications.
2739+
27382740@node Technical documentation
27392741@chapter Technical documentation
27402742
@@ -3665,27 +3667,6 @@ Using WebSocket is convenient because it is built in to modern browsers,
36653667so the entire front-end (except @code {terminal.js })
36663668is readily available.
36673669
3668- @subsection WebSocket server
3669-
3670- The included server uses @uref {http://java-websocket.org/ ,Java-WebServer },
3671- which is very compact and light-weight.
3672- The @code {java_websocket.jar } is checked in for convenience
3673- (though that may change).
3674-
3675- Each connection to the server creates a new process, but using the
3676- same @var {command } and @var {arg }s.
3677- (Multiple connections using @code {--process } will fail for some
3678- unknown reason.)
3679-
3680- (An older WebSocket server uses libraries from the
3681- @uref {https://tyrus.java.net/ ,Tyrus project }.
3682- These libraries are much bigger, but this implementation
3683- could be suitable for a JavaEE environment as it follows JSR-356.)
3684-
3685- If using PTYs, which requires native code anyway, it may be better
3686- to use a server written in C or C++, such as
3687- @uref {https://libwebsockets.org/ ,libwebsockets }.
3688-
36893670@subsection Line vs character input modes
36903671
36913672In line input mode we can end up with double echoing:
0 commit comments