# right-arrow or return = follow to sourced file, or edit the current block
# left-arrow or q = go up or exit
-;(signal 2 (fn (x) (exit)))
+(signal 2 (fn (x) (exit)))
(when (!= "0" (if (exec "id -u") ($it 0) ""))
- (let ((SUDO (if (exec "command -v sudo") ($it 0) "/usr/bin/sudo")))
- (wait-pid (process (join (cons SUDO (main-args) " ")))))
- (exit 0))
+ (let ((SUDO (if (exec "command -v sudo") ($it 0) "/usr/bin/sudo"))
+ (ED (format "env EDITOR=%s" (or (env "EDITOR") "nano"))) )
+ (wait-pid (process (join (flat (list SUDO ED (main-args))) " ")))
+ (exit 0)))
(constant
;; all "block starters", including blank lines