about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-01-26 23:58:21 +0100
committerProfpatsch <mail@profpatsch.de>2020-01-26 23:58:21 +0100
commita28d33c3b3b2a0d5457f71e2ff496ec07fd84551 (patch)
tree09daf91df90d42923807114f609b2eb9456661d2 /pkgs/profpatsch/execline
parenta553fada9be99e08a5436ad8b05a571861444cad (diff)
pkgs/profpatsch/execline/e: better prompt
rlwrap has to do magic recognition, which breaks in most cases.
We can just print a prompt before the first and after each consecutive
command. Seems to work wonderfully.
Diffstat (limited to 'pkgs/profpatsch/execline')
-rw-r--r--pkgs/profpatsch/execline/e.nix26
1 files changed, 14 insertions, 12 deletions
diff --git a/pkgs/profpatsch/execline/e.nix b/pkgs/profpatsch/execline/e.nix
index b2c32f8e..ca72c6f0 100644
--- a/pkgs/profpatsch/execline/e.nix
+++ b/pkgs/profpatsch/execline/e.nix
@@ -6,17 +6,19 @@ let
     // getBins pkgs.execline [ "execlineb" ];
 
   # minimal execline shell
-  e = writeExecline "e" {} [
-    bins.rlwrap
-      "--substitute-prompt" "e> "
-      "--remember"
-      "--quote-characters" "\""
-      "--complete-filenames"
-      "--ansi-colour-aware"
-      "--prompt-colour=yellow"
-    "forstdin" "-d\n" "cmd"
-    "importas" "cmd" "cmd"
-    bins.execlineb "-Pc" "$cmd"
-  ];
+  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; }