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.
 
 
 
 

30 lines
770 B

#use "topfind";;
#thread;;
#require "core";;
#require "core_unix";;
open Core;;
#require "lambda-term";;
let path = Core_unix.getcwd () in
let home = Sys.getenv_exn "HOME" in
let path =
if Zed_utf8.starts_with path home then
Zed_utf8.replace path 0 (Zed_utf8.length home) "~"
else
path
in
let user = Core_unix.getlogin () in
let version = Sys.ocaml_version in
let host = Core_unix.gethostname () in
let formatted = LTerm_text.eval
[B_bold true;
B_fg (LTerm_style.white); S "┌[";
B_fg (LTerm_style.lyellow); S (Printf.sprintf "%s@" user);
S (Printf.sprintf "ocaml-%s@%s " version host);
B_fg (LTerm_style.lcyan); S (Printf.sprintf "%s" path);
B_fg (LTerm_style.white); S "]\n└: "]
in UTop.prompt := fst (React.S.create formatted);;