···69697070 let h = ref []
71717272+ let add_history c =
7373+ let c = String.trim c in
7474+ let new_h = List.filter (fun s -> not (String.equal c s)) !h in
7575+ h := c :: new_h
7676+7277 let history prefix =
7378 if prefix <> "" then List.filter (fun s -> String.starts_with ~prefix s) !h
7479 else !h
···9095 | String (Some c) ->
9196 let ast = Ast.of_string (String.trim c) in
9297 let ctx', _ast = Eval.run ctx ast in
9393- h := c :: !h;
9898+ add_history c;
9499 loop ctx'
95100 | Ctrl_c ->
96101 let c = Exit.value ctx in