I'm remotely controlling my castnow session via KDEConnect.
The examples that utilize arrow-keys won't work there out of the box, because of some weird eval/escape issue.
But if you use '^[[D' instead of $'\e[D' than it works both from CLI and via KDEConnect.
I used showkey -a to figure this out.
Examples:
Seek backward.
Instead of
screen -S cast_session -X stuff $'\e[D'
use
screen -S cast_session -X stuff '^[[D'
Seek forward.
Instead of
screen -S cast_session -X stuff $'\e[C'
use
screen -S cast_session -X stuff '^[[C'