Package: tmux2html
tmux2html captures full tmux windows or individual panes then parses
their contents into HTML in living. The output can either be
still snapshots, or animated sequences.With a web server that uses gzip compression, the size over the network
is negligible for reasonably sized windows or panes.ExamplesSome of these may be large in dimensions. You’ll need to zoom out if you
want to see all panes at once. These are not raster graphics![disk: 135KB, gzip: 17KB]:https://share.esdf.io/FGlV4sufpt/color.htmlSingle Pane[disk: 124KB, gzip: 13KB]:https://share.esdf.io/oby611JQvB/single.htmlFull Window (Big)[disk: 237KB, gzip: 21KB]:https://share.esdf.io/9t7tgDC4Gf/full.htmlAnimated[disk: 204KB, gzip: 146KB]:https://share.esdf.io/sVu5q1xFk9/animated.htmlPartially Animated (Big)[disk: 122KB, gzip: 89KB]:https://share.esdf.io/UNoltIEHt4/partial-animated.html(Only some
panes are animating)Scrollable pane history[disk: 83KB, gzip: 47KB]:https://share.esdf.io/sEDNecDCat/scroll.html(Scroll with the mouse
wheel, or two fingers on a touch screen.)Complete pane history[disk: 63KB, gzip: 18KB]:https://share.esdf.io/bvn100jhi7/history.htmlOver kill animation[disk: 679KB, gzip: 516KB]:https://share.esdf.io/eSZQheewUL/absurd-animation.html(This
animation is recorded using a 10ms interval. It will not be great on
mobile devices.)“Streaming”:https://share.esdf.io/log.html(This displays the HTTP
log for the links above.)If you decide to look at the telnet animations yourself and don’t know
how to exit, useCtrl-]then typequit. For the Star Wars
animation, pressCtrl-]<enter>to get the prompt.RationaleThis was a weekend project I made for fun and I have no particular use
for it beyond annoying my friends about how bad they should feel for not
using tmux. I also thought it would be neat to have a render of my
sessions that didn’t result in an image using some crummy font on a
headless server.I suppose you can use cron to capture screens and display it on your
website, or use it to create terminal snippets for your blog. You could
also load a pane render in elinks within your coworker’s session. The
only limit is your imagination, my friend. :sparkles:What people think of tmux2htmltmux2html 便利そう。—@nakamurayaaaaoooooo—@l4utert9:39:46 PM Jef Myers: what the fuck is tmux?— Jef MyersRequirementstmux 1.8Python 2.7 or 3.4 (could be wrong since it’s not tested in lower
versions)Installationpipinstalltmux2htmlUsagetmux2html4-owindow_5_in_current_session.htmltmux2html.0-ofirst_pane_in_current_window.htmltmux2htmlother:1.2-osecond_window_third_pane_in_other_session.htmlCommand Line Optionstarget(positional) - Target window or pane. Uses tmux’s target
syntax, but always 0-indexed. (e.g.sess:1.2- Session - sess,
Window 2, Pane 3. Default target is window.)-o,--output- Output file. Prints to stdout if omitted.-m,--mode- Output file permissions. Default - 644--light- Light background.--interval- Number of seconds between captures.--duration- Number of seconds to capture. 0 for indefinite
recording, -1 to disable.--stream- Continuously renders until stopped and adds a script
to auto refresh based on--interval. See the notes below for more
info.--fg- Foreground color. Can be a color index or R,G,B--bg- Background color. Can be a color index or R,G,B--full- Renders the full history of a single pane--history- Specifies the maximum number of pane history lines to
include (implies--full)LimitationsThe cursor is not displayed.Basic colors will not match your terminal’s configured colors.Animations aren’t perfect with a lot of splits and fast resizing.[STRIKEOUT:Animations won’t capture scrolling the pane’s history
(selection mode).] Scrolling in the pane’s history is now recorded in
animations.[STRIKEOUT:In animations, a pane is updated with the full pane’s
content.] Only the changed lines are updated on a per-pane basis.Zoomed panes will ruin all the fun.Your imagination :stars:NotesStill captures are plain HTML and CSS.Animations use Javascript.To keep the size reasonable with animations,pakois used to inflate the
gzipped frame contents. Combined with decompression of frame content,
the animations will use a fair amount of CPU. So, you shouldn’t run
animations indefinitely on your low performance or battery operated
fun machines.--streamdoesn’t actually “stream”, per se. It keeps writing to
the same file and adds a script that reloads the contents. This can
be used to have a live feed of a window or pane. However, it’s not
elegant. If you set the interval to too low, your might
unintentionally DDoS your own web server. Caveat Emptor.The font stack includesPowerlineandNerdfonts because I’m
pedantic and want to see those fancy glyphs. It falls back tomonospaceif you don’t have any of those fonts installed. The
caveat: if you have more than one of those fonts installed, the first
one in the font stack might not be your favorite and you’ll be forced
to set your monitor on fire and buy a new one.To Do[STRIKEOUT:If there’s practical use for animations in the future,
only lines that are different should be updated to keep the size
low.]Tell people to follow me on Twitter
(@cloudsiphon) if they would
like to stay up to date on tmux2html, but don’t be pushy about it.Similar Projectsgotty- Share your terminal as a
web applicationasciinema- Terminal
session recorderLicensetmux2html: MITpako: MIT