about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/e.nix
blob: ca72c6f0d680612412cd90b5a65a67436ae75ca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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; }