mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 16:05:52 +03:00
[GH-ISSUE #255] Output recording to stdout #796
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#796
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sindresorhus on GitHub (Dec 29, 2017).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/255
Would be useful if
asciinemahad a flag to output the recording to stdout. This would make it easy to use the recording with other tools without having to write and then read a temp file.This is what I currently have to do:
This is how I'd like to use it:
Or just output to stdout if no filename is given.
This is the tool I'm using with
asciinema: https://github.com/marionebl/svg-term-cli// @marionebl
@ku1ik commented on GitHub (Apr 5, 2018):
If you redirectedasciinema rec's stdout to a pipe then you wouldn't see what you're doing in your terminal ;) The stdout has to go directly to terminal emulator, without any redirects/captures. In other words it's impossible to achieve it with pipe.But you can try this (works in bash, and probably in zsh too):
>(some command)runssome commandin a subshell, creates a file (pipe) at/dev/fd/...which is connected to this command's stdin, and then the whole>(...)expression is replaced with/dev/fd/...path :)I did it with
wc -l, which counted lines of the resulting recording, printing27:@chewi commented on GitHub (Dec 19, 2018):
I tried the
>()approach but it doesn't work now. It complains of an illegal seek.@ku1ik commented on GitHub (Dec 19, 2018):
That is an advanced bash trick, so it may not work in all cases.
@glaudiston commented on GitHub (Dec 3, 2020):
Have you tried with
echoandjqin bash ?:@ku1ik commented on GitHub (Feb 20, 2022):
The improvements from https://github.com/asciinema/asciinema/pull/473 make it possible to do this:
This will be released in v2.2.
@ku1ik commented on GitHub (Apr 28, 2022):
Also I just merged #492 which allows use of
-as the filename representing stdout, then piping the output to another tool:@sashaaro commented on GitHub (May 12, 2022):
@sickill can you implement read terminal stdout steam via pipe without specify and run command
actually I need it for use pipe programmly while write extension for https://github.com/vercel/hyper
idea in background run asciinema and forward stream to asciinema like
@ku1ik commented on GitHub (May 17, 2022):
@sashaaro You can do it the other way around:
Or if you explicitly want bash to execute the script (in case the script doesn't have shebang line):
@ku1ik commented on GitHub (May 17, 2022):
Closing this as support to record to stdout (by specifying
-as output filename) was added in 2.2.0.@sashaaro commented on GitHub (May 17, 2022):
@sickill unfortunately https://hyper.is/ plugins api does not allow to replace shell, hyper run shell command himself. I need run asciinema in backround separately and have method to send termianl stream to asciinema. Lets do asciinema just receive terminal stream via stdin pipe