about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/e.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/profpatsch/execline/e.nix')
-rw-r--r--pkgs/profpatsch/execline/e.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/profpatsch/execline/e.nix b/pkgs/profpatsch/execline/e.nix
new file mode 100644
index 00000000..ca72c6f0
--- /dev/null
+++ b/pkgs/profpatsch/execline/e.nix
@@ -0,0 +1,24 @@
+{ writeExecline, getBins, pkgs }:
+let
+
+  bins = getBins pkgs.rlwrap [ "rlwrap" ]
+    // getBins pkgs.s6-portable-utils [ { use = "s6-cat"; as = "cat"; } ]
+    // getBins pkgs.execline [ "execlineb" ];
+
+  # minimal execline shell
+  e =
+    let
+      prompt = [ "if" [ "printf" ''\e[0;33me>\e[0m '' ] ];
+    in
+      writeExecline "e" {} ([
+        bins.rlwrap
+          "--remember"
+          "--quote-characters" "\""
+          "--complete-filenames"
+      ] ++ prompt ++ [
+        "forstdin" "-d\n" "cmd"
+        "importas" "cmd" "cmd"
+        "foreground" [ bins.execlineb "-Pc" "$cmd" ]
+      ] ++ prompt);
+
+in { inherit e; }