github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/config/defaults/profile_posix.mx (about)

     1  function pwd_short {
     2      # normalise path to it's short form
     3      pwd -> regexp "s#^$HOME#\~#"
     4  }
     5  
     6  config set shell prompt {
     7      exitnum -> !if {
     8          out "{RESET}{YELLOW}${pwd_short -> grep -E -o '[^/]+$'} {GREEN}»{RESET} "
     9      } else {
    10          out "{RESET}{YELLOW}${pwd_short -> grep -E -o '[^/]+$'} {RED}»{RESET} "
    11      }
    12  }
    13  
    14  config set shell prompt-multiline {
    15      let len = ${pwd_short -> grep -E -o '[^/]+$' -> wc -c} - 1
    16      printf "%${$len}s » " $linenum
    17  }
    18  
    19  /#if { which less } then {
    20      function murex-docs {
    21          # Wrapper around builtin to pipe to less
    22          config set proc strict-arrays false
    23          fexec builtin murex-docs @PARAMS | less
    24      }
    25  }#/
    26  
    27  config eval shell safe-commands {
    28      -> alter --merge / ([
    29          "cat", "ps", "grep", "egrep", "ls", "head", "tail", "printf", "awk", "sed", "td", "cut"
    30      ])
    31  }