diff --git a/dune-project b/dune-project index f98ef1d..c2d2a56 100644 --- a/dune-project +++ b/dune-project @@ -36,8 +36,6 @@ (>= 0.37.0)) (ppx_deriving_yojson (>= 3.10.0)) - (globlon - (>= 0)) (fpath (>= 0.7.3)) (eio_posix diff --git a/merry.opam b/merry.opam index d4b5911..0e7949a 100644 --- a/merry.opam +++ b/merry.opam @@ -20,7 +20,6 @@ depends: [ "yojson" {= "2.2.2"} "ppxlib" {>= "0.37.0"} "ppx_deriving_yojson" {>= "3.10.0"} - "globlon" {>= "0"} "fpath" {>= "0.7.3"} "eio_posix" {= "1.3"} "eio" {= "1.3"} diff --git a/src/lib/interactive.ml b/src/lib/interactive.ml index dbcc51b..794ff2e 100644 --- a/src/lib/interactive.ml +++ b/src/lib/interactive.ml @@ -42,7 +42,7 @@ module Make (S : Types.State) (E : Types.Exec) (H : Types.History) = struct else if Sys.file_exists name then [ name ] else [] - let complete path = + let complete ~home:_ path = let rest, last_arg = String.split_on_char ' ' path |> List.rev |> function | [] -> ([], `None) @@ -109,6 +109,11 @@ module Make (S : Types.State) (E : Types.Exec) (H : Types.History) = struct | Some ("", rest) -> Some (rest, `Fg (`Hi `Magenta)) | _ -> None) in + let complete = + match S.lookup (Exit.value ctx |> Eval.state) ~param:"HOME" with + | Some home -> complete ~home + | None -> complete ~home:(Eunix.find_env "HOME") + in match Bruit.bruit ~hint ~history:(fun command -> H.history ~command !h |> H.commands) diff --git a/src/lib/posix/exec.ml b/src/lib/posix/exec.ml index c06e806..d239482 100644 --- a/src/lib/posix/exec.ml +++ b/src/lib/posix/exec.ml @@ -119,7 +119,7 @@ module Process_impl = struct let await t = match Eio.Promise.await @@ Process.exit_status t with | Unix.WEXITED i -> `Exited i - | Unix.WSIGNALED i -> `Signaled i + | Unix.WSIGNALED i -> `Signaled (128 + Sys.signal_to_int i) | Unix.WSTOPPED _ -> assert false let signal = Process.signal @@ -261,6 +261,7 @@ let pp_redirections ppf (i, fd, _) = Fmt.pf ppf "(%i,%a)" i Eio_unix.Fd.pp fd let run ~mode ?delay_reap _ ?stdin ?stdout ?stderr ?(fds = []) ?(fork_actions = []) ~pgid ~cwd ~pipe ?env ?executable args = + Sys.set_signal Sys.sigint Sys.Signal_default; with_close_list @@ fun to_close -> let check_fd n = function | Merry.Types.Parent_redirect (m, _, _) -> Int.equal n m