rash config: properly handle exceptions

This commit is contained in:
LordMZTE 2023-02-13 19:38:06 +01:00
parent 3c1d8a0555
commit 1e54350a90
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -5,5 +5,8 @@
readline/pread)
(current-prompt-function
(λ ()
(readline-prompt #{prompt show 0 insert |> port->bytes})))
(λ (#:last-return-value retval)
(unless (void? retval)
(display ((current-rash-top-level-print-formatter) retval)))
(readline-prompt #{prompt show (if (exn:fail? retval) 1 0) insert |> port->bytes})))