Hacker News new | comments | show | ask | jobs | submit login
Asciinema 2.0 (asciinema.org)
412 points by troydavis 7 months ago | hide | past | web | favorite | 46 comments



If the developer of asciinema is here, I just want to thank you for this amazing application. It is so useful and so easy to use. When I am learning something new in Linux, I research a lot and finally achieve something, only to forget how I did it a few months later. But with asciinema, I don't have this problem. I am able to record the stuff whenever I am doing anything new in Linux. Really glad to know about the 2.0 features especially that we don't lose the recording if it is interrupted.


I'm here :) I'm very happy asciinema is useful to you!


Thank you very much, it is a vital tool for me too.


If you just want to record, you could also try the script command, which comes preinstalled with most Unices. Asciinema's file format is more convenient for sharing and other niceties, but you probably won't have it installed everywhere. If you want to automatically record all SSH sessions on your server, script is the tool of choice.

I've also used it to fool programs that refuse to go into interactive mode when their input is not a TTY, but that's more of an abuse of script's purpose.


I've used script to run shell aliases defined in .bashrc in a cronjob. Normally you would use bash -ic my_alias in crontab to run my_alias, but this gives a warning from bash:

bash: cannot set terminal process group (1661): Inappropriate ioctl for device bash: no job control in this shell

With script -qc 'bash -ic my_alias' /dev/null, the warning goes away! (Of course, the real solution would be to turn my_alias into a proper shell script, but this works in a pinch when you have old habits to abide by.)


Also see ttyrec:

http://0xcc.net/ttyrec/


I have been a big supporter of script command, infact i never understood the drive for asciinema and others like it written in various languages. I see asciinema as a dependency to be installed by users to record a session.


script was main inspiration for asciinema. I read its source code many times, and in the very first version it was used for recording. However on BSD based systems (and so on macOS) the shipped version of script doesn't support writing to a timing file, which pretty much killed it there.

Anyway, if you're only interested in replay inside a terminal, and you don't care about sharing the recordings on the web then reaching for script first is my recommendation. However, if we forget about the web part, there are still useful things for local workflow, like idle time optimization, pausing/stepping through recording and a single recording file instead of 2 (if you record timing info with script).


I've used asciinema extensively over the years on my blog and for demos, and am delighted it's still getting attention.

Thank you Marcin Kulik!


I'm looking for a solution for creating short and clean screen casts for teaching programming.

I want to be able to prepare my scripts in advance and then play them when recording (or directly converting to something i can put in a webpage).

The best solution I've found to time is https://github.com/gu-fan/autotype.vim ... but in my tries it was flickering a bit too much.

Does anybody know a good, lightweight and free software solution that allows to move the cursor during the editing?


So nicely inspired by this thread /me is trying to create his first Atom package...


Is there any way to edit these files? I know they are just JSON and you can change the content of the files, but the timelines get kinda messed up.

Also, is there a way to capture the mouse input? I tried to make a simple demo for one of my projects but my cursor highlighting didn't show up.

Finally, is there a way to convert these into a animated GIF, like with ttygif?


> Also, is there a way to capture the mouse input?

This, AFAIK, only captures terminal output and timing.

> I tried to make a simple demo for one of my projects but my cursor highlighting didn't show up.

The cursor highlighting is a feature of the terminal, and is not part of the stream of text and terminal control codes that this tool captures, much like it won't capture the particular font or colors you may have configured. That said, some terminals allow mouse input, which is handed as control codes to the program connected to it. The program could use that to implement text marking.


That said, if you use a multiplexer like tmux, I think it would be able to capture the internal highlighting it uses, which can be mouse driven.


That's a great idea!



If I understand - with the piping you could share a read only terminal over the net?

My team has been using Atom and Teletype to pair - but no lightweight method to share the test console. Could this be it?


Yes, this is read-only. I believe it's a nice example of how you can combine different unix tools together to achieve interesting result. It's not a scalable, reliable streaming solution. But we'll get there :)

For collaboration tmate/tmux or atom+teletype are definitely better options these days.


I also understand it to be read only. Any reason why screen or tmux session sharing can't handle your use case?

On-topic: Great 2.0 release! Asciinema is great software for tutoring or showing off a terminal app, I use it a lot!


We have used tmux session sharing in the past over Vagrant share - none of us are on the same network. But I can’t say it is seemless. Tmate.io looks like a great solution.


I've used tmate for this purpose and it worked well.


Thanks! I'm glad it's useful to you!


Have you tried out teleconsole? I've used it quite a bit and I'm quite happy with it.

https://github.com/gravitational/teleconsole


tmate.io is what you are looking for


Tmate is life, I couldn't live without it. Such a fantastic piece of software.


Yes it is. Thank you


tmux/tmate?


GoTTY/ttyd can do this.


Few months ago I was desperate for a tool that recorded the terminal and allowed me to save the animation as a GIF. While asciinema (at least at that time) didn’t have any straightforward way to do this, I looked elsewhere and found https://gifox.io and must admit have been very impressed with it.


You can use https://github.com/asciinema/asciicast2gif to turn asciicast into GIF animation.


Ignoring the terminal capture for a moment and focussing on the gif part: how does it compare to LICEcap? I haven't used it in a while but development seems to have resumed[0].

On Linux, there is also peek[1], and on Windows, there is ScreenToGif[2]. Both are open source.

Another option is to use screencasting software like OBS Studio[3] (and for Linux, I highly recommend SimpleScreenRecorder[4]) to get a high-quality video capture, then throwing it through gifski[5] to get really high quality GIFs.

Especially if you plan on uploading to a gif-site you might as well just capture video and upload that - they tend to do gif-conversion themselves these days.

[0] https://www.cockos.com/licecap/

[1] https://github.com/phw/peek

[2] http://www.screentogif.com/

[3] https://obsproject.com/

[4] http://www.maartenbaert.be/simplescreenrecorder/

[5] https://gif.ski/


Kudos to the developer. Is there any windows version planned for it? Or any other similar software for Windows?


There's no native support for Windows due to completely different way of terminal is implemented in Windows and Unix-like systems. But there are some options to have it working, see this thread: https://github.com/asciinema/asciinema/issues/150 (use a fork, or run asciinema in WSL bash).


Thanks for that one, very funny, hahaha. Sure you can try to invite our nice terminal-juggling mouse friend at some huge old heavy sweaty dusty elephant home and see if they play well along.

Anyway, trying to always add genuine value, have you even Googled? Those come really easy: https://alternativeto.net/software/asciinema/ https://github.com/asciinema/asciinema/issues/150 https://github.com/asciinema/asciinema/issues/47

Short answer: a windows-friendly hackish branch exists. And original works if you're actually running asciinema in the port of Ubuntu that Microsoft ships with recent Win10. Does it satisfy any use case that you had in mind?


This is the first I've read of the JSON Lines format. What problem does this solve?

*answered my question shortly after posting by re-reading the blog post: "enables incremental writing and reading of the recording."

So it makes streaming data a lot easier.


JSON lines is fairly common in cases where you don't want to hold the entire file in memory.


The first (and pretty much only time) I've run into this file format is with Apache Spark: https://spark.apache.org/docs/latest/sql-programming-guide.h...


Chrome refuses to load this due to an HSTS error. Any mirrors?


Oh, that's a bummer. I'll fix that!


Oh rats. I thought this was going to be the Star Wars movie rendered in ASCII!


You mean this one? http://www.asciimation.co.nz/


Best version ever! Love the use of @ for Leia's cinnamon rolls.

But I had thought it might be an actual ascii rendering, like people used to do for photos. Essentially, regard the tty screen as an 80*25 set of 'pixels'. Then pick the closest match ASCII character and foreground/background color for each 'pixel'.



It definitely loses something in a browser, as opposed to the days when you could watch it stream direct to your terminal via telnet to towel.blinkenlghts.nl


When did that go away? Just checked chat logs and I most recently introduced someone to that on Jan 19th.


libaa and libcaca (color) should be still around.




Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: