configurations and the like
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
721 B

  1. #use "topfind";;
  2. #require "core";;
  3. open Core;;
  4. #require "lambda-term";;
  5. let path = Sys.getcwd () in
  6. let home = Sys.home_directory () in
  7. let path =
  8. if Zed_utf8.starts_with path home then
  9. Zed_utf8.replace path 0 (Zed_utf8.length home) "~"
  10. else
  11. path
  12. in
  13. let user = Unix.getlogin () in
  14. let version = Sys.ocaml_version in
  15. let host = Unix.gethostname () in
  16. let formatted = LTerm_text.eval
  17. [B_bold true;
  18. B_fg (LTerm_style.white); S "┌[";
  19. B_fg (LTerm_style.lyellow); S (Printf.sprintf "%s@" user);
  20. S (Printf.sprintf "ocaml-%s@%s " version host);
  21. B_fg (LTerm_style.lcyan); S (Printf.sprintf "%s" path);
  22. B_fg (LTerm_style.white); S "]\n└: "]
  23. in UTop.prompt := fst (React.S.create formatted);;