mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-24 23:45:50 +03:00
2
Terminal to terminal streaming tips
Marcin Kulik edited this page 2021-01-07 23:53:05 +01:00
Great tip from @benaryorg:
A great opportunity to bring up the little known tail idiom: tail -fn +1 file
With that you can effectively output an entire file while still tailing it. That means you can stream without any complicated pipe setup:
# record
asciinema rec file.cast
# play
tail -fn +1 file.cast | asciinema play -
# play via ssh
ssh example.com tail -fn +1 file.cast | asciinema play -
Edit: for lots of output (e.g. coloured stuff like syntax highlighting in shell or editor) I recommend putting a buffer in between to account for network latency and such:
ssh example.com tail -fn +1 file.cast | pv -qB 8m | asciinema play -
Edit2: should be all uppercase -B in the pv invocations
Edit3: and there's the fitting cast: https://asciinema.org/a/163778
Edit4: the ssh-streaming part should also be applicable