|
|
|
|
|
by andyk
739 days ago
|
|
andyk here. it's clear our readme is lacking use cases! adding some now. When we introduced ht on twitter I gave a little more context -- https://x.com/andykonwinski/status/1796589953205584234 -- but that should have been in the project readme. Also a few people comparing to `expect`. I haven't used `expect` before, but it looks very cool. Their docs/readme seem only slightly more fleshed out than ours :-D
Looks like the main way to use expect is via: spawn ...
expect ...
send ...
expect ...
etc.
so, the expect syntax seems targeted more towards testing where you simultaneously get the output from the underlying binary and then check if it's what you expect (thus the name I guess). I can't see if there is a way to just get the current terminal "view" (aka text screenshot) via an expect command?ht is more geared towards scripting (or otherwise programmatically accessing) the terminal as a UI (aka Terminal UI). So ht always runs a terminal for you and gives you access to the current terminal state. Need to try out expect myself, but from what I can tell, it doesn't seem to always transparently run a Terminal for you. There might already be some other existing tool that overlaps with the ht functionality, but we couldn't find it when looked around a bunch before building ht. |
|
Expect is also extra cool because of `autoexpect'.
https://manpages.ubuntu.com/manpages/focal/en/man1/autoexpec...