News for hackers. Stuff that matters.
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.