local topic filename ret
topic="${(j:_:)@}"
filename="${TMPDIR:-/tmp}/script.${topic:-$LOGNAME}.$$.$(date +%Y%m%d.%H%M)"
-PS1="%# " script -c "zsh -f" -f -q
+echo "I: writing typescript to $filename ..." >&2
+PS1="%# " PS2= RPS1= script -c "zsh -f" -f -q "$filename"
ret=$?
-echo "$filename"
+echo "I: typescript is in $filename ."
return $ret
exit $ret