Shells in OCaml
3
fork

Configure Feed

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

Support $-

+15 -2
+8
src/lib/built_ins.ml
··· 30 30 type merry = [ `Async ] 31 31 type option = [ posix | merry ] 32 32 33 + let posix_to_letter = function 34 + | `Noclobber -> "C" 35 + | _ -> "" 36 + 37 + let to_letters t = 38 + let nc = if t.noclobber then posix_to_letter `Noclobber else "" in 39 + nc ^ "" 40 + 33 41 let update t options = 34 42 List.fold_left 35 43 (fun d -> function
+2
src/lib/built_ins.mli
··· 7 7 async : bool; 8 8 } 9 9 10 + val to_letters : t -> string 11 + 10 12 type posix = [ `Noclobber | `Pipefail | `Noglob | `Nounset ] 11 13 type merry = [ `Async ] 12 14 type option = [ posix | merry ]
-2
src/lib/eunix.ml
··· 25 25 let shell_pid = Unix.getpid () in 26 26 Fun.protect 27 27 ~finally:(fun () -> 28 - Fmt.pr "Back to the shell\n%!"; 29 28 let _ : int = tcsetpgrp 0 shell_pid in 30 29 ()) 31 30 (fun () -> 32 - Fmt.pr "Delegating...\n%!"; 33 31 match tcsetpgrp (Obj.magic Unix.stdin : int) pgid with 34 32 | 0 -> fn () 35 33 | n -> Fmt.failwith "tcsetpgrp: %i" n)
+5
src/lib/eval.ml
··· 604 604 expand 605 605 ([ Ast.WordName ctx.last_background_process ] :: acc) 606 606 ctx rest 607 + | Ast.VariableAtom ("-", NoAttribute) -> 608 + let i = if ctx.interactive then "i" else "" in 609 + expand 610 + ([ Ast.WordName (Built_ins.Options.to_letters ctx.options ^ i) ] :: acc) 611 + ctx rest 607 612 | Ast.VariableAtom (n, NoAttribute) 608 613 when Option.is_some (int_of_string_opt n) -> ( 609 614 let n = int_of_string n in