From 1e54350a900cf2c718c0bdb9bd8ed99ae0468916 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Mon, 13 Feb 2023 19:38:06 +0100 Subject: [PATCH] rash config: properly handle exceptions --- .config/rash/rashrc.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.config/rash/rashrc.rkt b/.config/rash/rashrc.rkt index a1bda47..95e0553 100644 --- a/.config/rash/rashrc.rkt +++ b/.config/rash/rashrc.rkt @@ -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})))