legneato / asciinema-rs Goto Github PK
View Code? Open in Web Editor NEWAsciinema client written in Rust
License: Apache License 2.0
Asciinema client written in Rust
License: Apache License 2.0
See https://asciinema.org/docs/usage.
Sort of depends on #9.
See https://asciinema.org/docs/usage.
Depends on #5 to be useful.
See https://asciinema.org/docs/usage.
The function that receives input from the terminal is already stubbed out here: https://github.com/LegNeato/asciinema-rs/blob/master/src/commands/record.rs#L82. You basically need to copy what output()
below does, changing asciicast::EventType::Output
to asciicast::EventType::Input
. Don't forget add a test! An example test can be seen at https://github.com/LegNeato/asciinema-rs/blob/master/src/commands/record.rs#L255
:::akavel@k14:::~/dnload/asciinema/asciinema-v0.4.0-x86_64-unknown-linux-musl$ ./asciinema rec
⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ 🔴 [RECORDING] ⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
akavel@k14:~/dnload/asciinema/asciinema-v0.4.0-x86_64-unknown-linux-musl$ echo hello world
hello world
akavel@k14:~/dnload/asciinema/asciinema-v0.4.0-x86_64-unknown-linux-musl$ exit
https://asciinema.org/api/asciicasts: The OpenSSL library reported an error: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed:s3_clnt.c:1269:
:::akavel@k14:::~/dnload/asciinema/asciinema-v0.4.0-x86_64-unknown-linux-musl$
Not sure if this is a bug in the app or an issue with the OS (it's on a hosted machine, so I don't have control over versions of installed libs etc.)
See https://asciinema.org/docs/usage. Play has a lot of functionality so it might be best to break it up into different tasks and PRs for each bit.
In #12 we added some aliases. It might be good to switch wholesale to AppSettings::InferSubcommands
(https://docs.rs/clap/2.26.2/clap/enum.AppSettings.html).
Users can set a different url
in their config or as an env variable: https://asciinema.org/docs/config. We currently support this, but we don't change the hostname in messages to the user. If one is set, we should use the url's hostname rather than hardcoding asciinema.org.
See https://asciinema.org/docs/usage.
This is likely more involved and requires changes to pty-shell
. As it currently stands, running a single command causes stdout
to die and the program to go in an infinite loop.
We should use https://docs.rs/portable-pty/0.4.0/portable_pty/ as it is more modem and supported
Currently we always write to a temp file and then copy the temp file at the end of the session. If we are passed a local file (asciinema rec /path/to/file
), we should write to the file directly. This will make it so users can stream as mentioned in http://blog.asciinema.org/post/two-point-o/.
pty-shell
is no longer maintained and uses mio
directly. It would be nice to switch to tokio
. As a bonus this will also likely enable us to ship to crates.io.
From https://asciinema.org/docs/usage:
ASCIINEMA_REC=1 is added to recorded process environment variables. This can be used by your shell’s config file (.bashrc, .zshrc) to alter the prompt or play a sound when the shell is being recorded.
If we are playing back a recoding that was recoded in a smaller terminal, we should "letterbox" the output in the larger playback terminal so that the recording appears correct. We likely want to do something with curses
to be fancy.
We don't do any translation of the output data, so playing back in a smaller terminal may not work correctly depending on what happens in the recording session. We should warn in this case.
We should support writing directly and converting to some movie format.
It would be neat to have a progress bar while uploading. It should respect the --quiet
option.
After running asciinema rec
, the reference python client prompts the user with the option to upload or save locally to a temp file. We currently do not prompt and instead always upload.
We should support writing directly and converting to SVG.
I might be a good idea to build a new tool or sub-command which convert cast to gif(or svg). Original asciinema2gif is useful but installing deps is boring :)
asciinema2gif: link
We turned off parallel tests (ec26f54), as tests for the configuration use env variables and interfere with each other. We should fix this.
The official python program supports rec
, play
, cat
, upload
, and auth
commands. For the two shortened ones (rec
and auth
) we should alias the full words as well to be friendlier (record
and authenticate
respectively).
error: failed to run custom build command for `openssl v0.9.24`
process didn't exit successfully: `/build/asciinema-rs/src/asciinema-rs-0.5.0/target/release/build/openssl-0afee69c03b43007/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
The docs at https://asciinema.org/docs/config suggest the location of the asciinema config based on some rules. It appears that the reference python binary ignores these for the install-id
file and blindly writes it to $HOME/.asciinema/install-id
(at least on macOS).
We should load from $HOME/.asciinema/install-id
if it exists to reuse the install-id from the official client. If it doesn't exist, we should strive to be consistent and load from the directory specified in https://asciinema.org/docs/config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.