mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 07:55:51 +03:00
[GH-ISSUE #393] Presentation mode, for playing back keystrokes when pressing keys #859
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#859
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 @skorokithakis on GitHub (Feb 28, 2020).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/393
This is a bit of a weird request, but asciinema would be extremely useful in presentations if it could play back my keystrokes when I actually pressed keys, to make it look like I'm live-typing.
Ie it would record when I pressed keys during the recording, and advance the playback from keystroke to keystroke when I pressed any key on the keyboard.
Is this possible to do with the current format/code? If not, what would I need to change to implement this? Any pointers would be appreciated.
@skorokithakis commented on GitHub (Feb 28, 2020):
I have hacked together an implementation of this here:
https://github.com/asciinema/asciinema/compare/develop...skorokithakis:develop
Would anyone be interested in it? It works quite well, though it might need some more features before being releasable, but I can work on it some more if there's interest.
@ahillio commented on GitHub (Mar 2, 2020):
Oh that's exciting. I look forward to trying this out :)
@skorokithakis commented on GitHub (Mar 2, 2020):
It works rather well, unfortunately it has some disadvantages for presentations, eg if you're writing code you can't switch to another window and run it, as it's all a recording, and you can't pause and resume, or easily edit the commands.
I'm looking into using the methods used by asciinema to create a player that will read a list of commands from a file and type them into a terminal as you type, with options to take over, skip forward/back, see the next commands, etc.
I might post here if there's interest, though it would probably be a separate tool so there's not much sense spamming this issue with that.
@ahillio commented on GitHub (Mar 2, 2020):
Could pause/resume be added back with the functionality you've demonstrated in this patch?
My zsh config has vi-mode and it'd be awesome for a recording to show the keys that are pressed in vi-mode.
I just tried your patch by cloning your repo with the
Implement wait-for-keyscommit and then from inside that directory usingpython3 -m asciinema rec testfile.castbut I didn't see any indication of the key presses when doingpython3 -m asciinema play testfile.cast. Is there a way to toggle the keystroke indication? Or was I testing it incorrectly?@skorokithakis commented on GitHub (Mar 2, 2020):
The functionality can certainly be added back, I just removed it to test. The keystrokes don't currently show, this PR is just for only playing the input when pressing keys.
You need to record with
--stdinfor this to work, by the way.@ahillio commented on GitHub (Mar 13, 2020):
I still plan to try this feature again with your recent suggestion.
I'm also curious to see this possible other project you mentioned and wonder if/how it may be similar/different from https://github.com/sloria/doitlive...?
@skorokithakis commented on GitHub (Mar 13, 2020):
I have tried doitlive and it only worked with the shell and ipython. I used asciinema's terminal code to make It's a Live:
https://gitlab.com/stavros/itsalive
Thanks to asciinema, It's a Live works on every program (nesting two It's a Live sessions possibly doesn't work well though). It also includes a curses-based presenter view, pausing/resuming and other shortcuts.
@nrktkt commented on GitHub (Mar 17, 2022):
I'd love a version of this where you can set pause/breakpoints in the recording. I don't need to show one character of the recording for every key I press, just to automatically pause the playback at specified points and resume on some command (keypress, press play, whatever)
@skorokithakis commented on GitHub (Mar 17, 2022):
@nrktkt It's a Live can already do that.
@nrktkt commented on GitHub (Mar 17, 2022):
@skorokithakis thanks for that realtime response
It's a Live requires you to actually run the commands in the terminal though right? ie. you couldn't playback in the browser
@skorokithakis commented on GitHub (Mar 17, 2022):
@nrktkt Ah, yes, it does need the terminal, correct. You want playback to keep playing on its own until you pause? It can't do that, I'm afraid... I thought you meant the opposite, i.e. type out the entire command with one key press.
@nrktkt commented on GitHub (Mar 18, 2022):
I'd want something halfway between asciinema and It's a Live. So both the input and output are pre-recorded (like asciinema), but with the ability to pause before each command (like It's a Live).
So if I were to present, I wouldn't need to use my computer to do the presentation
@skorokithakis commented on GitHub (Mar 18, 2022):
Hmm, I think you may be able to fairly easily hack Asciinema to pause before the start of each line of input and wait for a keypress.
@nrktkt commented on GitHub (Mar 18, 2022):
I'd need some pointers on that. Would I be editing asciinema's source or doing something with my terminal recording or?
@skorokithakis commented on GitHub (Mar 18, 2022):
Yeah, you'd have to modify the source, I think.