Shells in OCaml
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Skip making process group in interactive mode

This was causing the shell to not be able to read STDIN in interactive
mode.

+6 -3
+3 -1
src/lib/eval.ml
··· 1665 1665 Exit.zero initial_ctx 1666 1666 1667 1667 and execute ctx ast = exec ctx ast 1668 - and run ctx ast = run' ~make_process_group:true ctx ast 1668 + 1669 + and run ?(make_process_group = true) ctx ast = 1670 + run' ~make_process_group ctx ast 1669 1671 1670 1672 and run' ?(make_process_group = true) ctx ast = 1671 1673 (* Make the shell its own process group *)
+2 -1
src/lib/eval.mli
··· 45 45 val sigint_set : ctx -> bool 46 46 (** Has the signal SIGINT been set via a trap. *) 47 47 48 - val run : ctx Exit.t -> Ast.t -> ctx Exit.t * Ast.t list 48 + val run : 49 + ?make_process_group:bool -> ctx Exit.t -> Ast.t -> ctx Exit.t * Ast.t list 49 50 (** [run ctx ast] evaluates [ast] using the initial [ctx]. *) 50 51 51 52 (** {2 Private} *)
+1 -1
src/lib/interactive.ml
··· 120 120 | String (Some c) -> 121 121 let ast = Ast.of_string (String.trim c) in 122 122 Fmt.pr "\n%!"; 123 - let ctx', _ast = Eval.run ctx ast in 123 + let ctx', _ast = Eval.run ~make_process_group:false ctx ast in 124 124 add_history c; 125 125 H.save !h history; 126 126 loop ctx'