1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
{ depot, pkgs, ... }:
let
inherit (depot.nix) writeExecline getBins;
bins = getBins pkgs.rlwrap [ "rlwrap" ]
// getBins pkgs.s6-portable-utils [ { use = "s6-cat"; as = "cat"; } ]
// getBins pkgs.execline [ "execlineb" ];
shell =
let
prompt = [ "if" [ "printf" ''\e[0;33me>\e[0m '' ] ];
in writeExecline "execline-shell" {} ([
bins.rlwrap
"--remember"
"--quote-characters" "\""
"--complete-filenames"
"--ansi-colour-aware"
] ++ prompt ++ [
"forstdin" "-d\n" "cmd"
"importas" "cmd" "cmd"
"foreground" [ bins.execlineb "-Pc" "$cmd" ]
] ++ prompt);
in pkgs.writers.writeDash "e" ''
set -e
if [ $# -eq 0 ]; then
${shell}
else
export EXECLINE_STRICT=2
${depot.users.Profpatsch.execline.run-cmd-line-block}/bin/run-cmd-line-block "$@"
fi
''
|