tweekmonster / tmux2html

:cat2: Render full tmux windows or individual panes as HTML
MIT License
714 stars 16 forks source link

Question/Feature Request: control #11

Open faxm0dem opened 8 years ago

faxm0dem commented 8 years ago

Is there any way I could control the playback? The best would be to be able (like ttyplay) to pause/resume/change_playback_speed with the press of a key, but I understand this would involve writing a js handler.

What I need right now would be a way to defer the playback (I'm embedding tmux2html into a reveal.js presentation)

Cheers

tweekmonster commented 8 years ago

This is something I want to add formally. There is a very rudimentary JS interface for it right now, though: tmux.stop(), tmux.resume(), and tmux.next()

tweekmonster commented 8 years ago

I added tmux.setSpeedMultiplier(). You can view the commit for details.

What I need right now would be a way to defer the playback (I'm embedding tmux2html into a reveal.js presentation)

I'm not sure if reveal.js allows you to include your own javascript, but you should be able to call out to the tmux functions within an iframe. If you want to ensure that the animation starts paused, you can do this after the HTML is written:

echo '<script>tmux.stop();</script>' >> /tmp/realtime.html

I'm leaving this issue open since I want to add keyboard shortcuts later in the near future.

faxm0dem commented 7 years ago

just tried tmux.stop() and tmux.resume() they work like a charm thanks!

tweekmonster commented 7 years ago

*checks today's date*