From a28d33c3b3b2a0d5457f71e2ff496ec07fd84551 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 26 Jan 2020 23:58:21 +0100 Subject: 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. --- pkgs/profpatsch/execline/e.nix | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'pkgs/profpatsch/execline') 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; } -- cgit 1.4.1