2023-02-12 11:09:41 +01:00
|
|
|
#lang rash
|
|
|
|
(require
|
|
|
|
racket/port
|
|
|
|
rash/private/rashrc-lib
|
|
|
|
readline/pread)
|
|
|
|
|
2023-04-07 15:38:29 +02:00
|
|
|
(provide nv)
|
|
|
|
|
2023-02-12 11:09:41 +01:00
|
|
|
(current-prompt-function
|
2023-11-14 19:25:42 +01:00
|
|
|
(λ (#:last-return-value retval
|
|
|
|
#:last-command-duration duration)
|
2023-02-13 19:38:06 +01:00
|
|
|
(unless (void? retval)
|
|
|
|
(display ((current-rash-top-level-print-formatter) retval)))
|
|
|
|
|
2023-11-12 17:00:52 +01:00
|
|
|
(parameterize ([current-environment-variables (environment-variables-copy (current-environment-variables))])
|
|
|
|
(putenv "MZPROMPT_STATUS" (if (exn:fail? retval) "1" "0"))
|
|
|
|
(putenv "MZPROMPT_FISH_MODE" "insert")
|
2023-11-14 19:25:42 +01:00
|
|
|
(putenv "MZPROMPT_DURATION" (number->string duration))
|
2023-11-12 17:00:52 +01:00
|
|
|
(putenv "MZPROMPT_JOBS" "0")
|
|
|
|
(readline-prompt #{prompt show |> port->bytes}))))
|
2023-04-07 15:38:29 +02:00
|
|
|
|
|
|
|
(define-simple-pipeline-alias nv nvim)
|