News for hackers. Stuff that matters.
Re:Asciinema 3.0 will be rewritten in Rust by grimgrin on Wednesday February 07, 2024 @09:08PM (#39296977)
now you can compare asciinema (rust) to vhs (go)

I still use and love asciinema, but will eventually check out vhs. It records terminal activity, outputs a gif, and you can publish to their[1] server.

Alternative you can feed it a "tape" file, aka a text file with a few configuration options and your ordered commands to run.

My workflow with asciinema sometimes has me cancelling out to redo w/ some minor change, so this tape concept is really attractive

1. https://github.com/charmbracelet/vhs

Re:Asciinema 3.0 will be rewritten in Rust by pests on Wednesday February 07, 2024 @09:17PM (#39297029)
Does VHS have a way to add commands?

I do like the concept but one charming feature of asciinema is it captures natural input hesitation, typing candence, deletions and fixing mistakes, etc. The VHS tape replay seems so artifical.

I could see how to fake it with the current commands, but I could imagine a "HumanType" or something which increases the delay variance or includes typos that are backspaced and fixed etc, automatically.

Just a quick ponder.

Re:Asciinema 3.0 will be rewritten in Rust by alain_gilbert on Wednesday February 07, 2024 @11:27PM (#39298134)
https://github.com/charmbracelet/vhs/blob/main/record.go#L22

I was looking at the code, and it seems like you could put a low value for this and it would do what you want.

I did not try it though

  // sleepThreshold is the time at which if there has been no activity in the
  // tape file we insert a Sleep command
  const sleepThreshold = 500 * time.Millisecond
EDIT:

I tested it. It actually work, but their software crash, I had to patch line 153

  for lines[i] == lines[i+repeat] {
    repeat++
    if i+repeat == len(lines) {
      break
    }
  }
EDIT 2:

I actually went ahead and created a pull request to fix the bug.

https://github.com/charmbracelet/vhs/pull/446

Re:Asciinema 3.0 will be rewritten in Rust by grimgrin on Wednesday February 07, 2024 @09:23PM (#39297087)
I think it'll cover your needs. You can configure typing speeds, send commands for backspacing, if you were driving vim you could obv record doing search/replace/deletions

The fact you can iterate at all is its appeal to me

https://github.com/charmbracelet/vhs?tab=readme-ov-file#vhs-...

Re:Asciinema 3.0 will be rewritten in Rust by pests on Wednesday February 07, 2024 @09:45PM (#39297288)
I saw that, yeah, but I don't want to do that manually.

A custom command that could add some jitter automatically or just pretend to be a bit more human would be nice.

Lets type "ls -lap" with some hesitation and a typo...

  Type "ls "
  Sleep 200
  Type "-"
  Sleep 300
  Type "l"
  Sleep 50
  Type "aa"
  Sleep 100
  Backspace
  Sleep 150
  Type "p"
  Enter
:(

There is the TypingSpeed variable but its not exactly what I'm going for.

Re:Asciinema 3.0 will be rewritten in Rust by zackproser on Wednesday February 07, 2024 @09:25PM (#39297106)
I appreciate and use asciinema, but a big plus one for VHS.

I like being able to store my tapes in a repo and edit them:

https://github.com/zackproser/vhs-scratch

And as the official VHS docs show you can do even more interesting things with CI/CD

Re:Asciinema 3.0 will be rewritten in Rust by pstuart on Wednesday February 07, 2024 @09:17PM (#39297026)
The charmbracelet team is rocking the command line with Go.
Re:Asciinema 3.0 will be rewritten in Rust by bhub on Thursday February 08, 2024 @01:45AM (#39299014)
Surprised no one has mentioned the big difference in that you can copy paste from asciinema animations but not from a vhs gif. At least last I looked it was like that.
Re:Asciinema 3.0 will be rewritten in Rust by srid on Thursday February 08, 2024 @03:07AM (#39299512)
VHS interesting, because you declaratively specify what you are recording and version control it.

However, I quickly hit a painful limitation, viz.: if a command takes non-trivial amount of time to run, you need to hack it by using `Sleep` to wait for command output. So I'm not fully convinced to switch from asciinema.