terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

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

remove all references to eio

+2 -72
-2
dune-project
··· 26 26 stdio 27 27 nottui 28 28 base 29 - eio_main 30 29 angstrom 31 30 ppx_expect 32 31 ppx_jane 33 - eio-process 34 32 35 33 (picos_std (= 0.5.0)) 36 34 (picos_io (= 0.5.0))
-30
flake.nix
··· 145 145 146 146 strictDeps = true; 147 147 }; 148 - eio-process = ocamlPackages.buildDunePackage { 149 - pname = "eio-process"; 150 - version = "0.1.0"; 151 - duneVersion = "3"; 152 - src = pkgs.fetchFromGitHub { 153 - 154 - owner = "mbarbin"; 155 - repo = "eio-process"; 156 - rev = "482ba341884dc8711f93ec9cc6d7c941099e0faa"; 157 - sha256 = "sha256-/Y2U+1y+nDMBrRfDAYif0WJp0vPWmvbSMt39wAB/rS8="; 158 - }; 159 - 160 - buildInputs = with ocamlPackages; [ 161 - base 162 - eio 163 - parsexp 164 - ppx_compare 165 - ppx_enumerate 166 - ppx_hash 167 - ppx_here 168 - ppx_let 169 - ppx_sexp_conv 170 - ppx_sexp_value 171 - ]; 172 - 173 - strictDeps = true; 174 - 175 - }; 176 148 177 149 signal = ocamlPackages.buildDunePackage { 178 150 pname = "signal"; ··· 250 222 lwd 251 223 notty-mine 252 224 nottui 253 - eio-process 254 225 picos 255 226 picos_std 256 227 picos_io ··· 272 243 273 244 ocamlPackages.spawn 274 245 ocamlPackages.parsexp 275 - ocamlPackages.eio_main 276 246 ocamlPackages.stdio 277 247 ocamlPackages.base 278 248 ocamlPackages.angstrom
-2
jj_tui.opam
··· 16 16 "stdio" 17 17 "nottui" 18 18 "base" 19 - "eio_main" 20 19 "angstrom" 21 20 "ppx_expect" 22 21 "ppx_jane" 23 - "eio-process" 24 22 "picos_std" {= "0.5.0"} 25 23 "picos_io" {= "0.5.0"} 26 24 "uutf"
+1 -1
jj_tui/bin/dune
··· 1 1 (executable 2 2 (public_name jj_tui) 3 3 (name main) 4 - (libraries signal jj_tui nottui base stdio picos_io picos_mux.multififo picos_std.sync picos_std.finally picos_std.structured eio_main eio-process spawn ) 4 + (libraries signal jj_tui nottui base stdio picos_io picos_mux.multififo picos_std.sync picos_std.finally picos_std.structured spawn ) 5 5 6 6 (preprocess 7 7 (pps logs-ppx ppx_deriving.std))
-32
jj_tui/bin/global_vars.ml
··· 1 1 open Notty 2 2 open Nottui 3 - open Eio.Std 4 3 open Picos_std_structured 5 4 open Lwd_infix 6 5 open Jj_tui.Process ··· 47 46 48 47 (** Global variables for the ui. Here we keep anything that's just a pain to pipe around*) 49 48 module type Vars = sig 50 - type eio_vars = { 51 - env : Eio_unix.Stdenv.base 52 - ; mgr : Eio_unix.Process.mgr_ty Eio.Resource.t 53 - ; cwd : Eio.Fs.dir_ty Eio.Path.t 54 - } 55 49 56 50 val quit : bool Lwd.var 57 51 val term : Notty_unix.Term.t option ref 58 52 val term_width_height : (int * int) Lwd.var 59 - val get_eio_env : unit -> Eio_unix.Stdenv.base 60 - val set_eio_env : Eio_unix.Stdenv.base -> unit 61 - val get_eio_vars : unit -> eio_vars 62 53 val get_term : unit -> Notty_unix.Term.t 63 54 val ui_state : ui_state_t 64 - val update_ui_state : (ui_state_t -> unit) -> unit 65 - val render_mutex : Eio.Mutex.t 66 55 val reset_selection : unit -> unit 67 56 68 57 (**returns either a change_id or if their are change_id conflicts, a commit_id *) ··· 78 67 end 79 68 80 69 module Vars : Vars = struct 81 - type eio_vars = { 82 - env : Eio_unix.Stdenv.base 83 - ; mgr : Eio_unix.Process.mgr_ty Eio.Resource.t 84 - ; cwd : Eio.Fs.dir_ty Eio.Path.t 85 - } 86 70 87 71 let quit = Lwd.var false 88 - let eio = ref None 89 72 90 - (** DONT DIRECTLY SET FROM EIO FIBERS!! When setting variables within a fiber use update_ui_state*) 91 73 let ui_state = 92 74 { 93 75 view = Lwd.var `Main ··· 109 91 } 110 92 ;; 111 93 112 - (** allows other fibers to set lwd vars only when not during rendering*) 113 - let render_mutex = Eio.Mutex.create () 114 94 115 - (** Safely ensures your update doesn't occur during a render*) 116 - let update_ui_state f = 117 - Eio.Mutex.lock render_mutex; 118 - f ui_state; 119 - Eio.Mutex.unlock render_mutex 120 - ;; 121 - 122 - let set_eio_env env = 123 - eio := Some { env; mgr = Eio.Stdenv.process_mgr env; cwd = Eio.Stdenv.cwd env } 124 - ;; 125 95 126 96 let term = ref None 127 97 let term_width_height : (int * int) Lwd.var = Lwd.var (0, 0) 128 - let get_eio_env () = (Option.get !eio).env 129 - let get_eio_vars () = Option.get !eio 130 98 let get_term () = Option.get !term 131 99 132 100 let reset_selection () =
-2
jj_tui/bin/jj_ui.ml
··· 176 176 while true do 177 177 Picos.Fiber.sleep ~seconds:5.0; 178 178 (*we need to lock this becasue we could end up updating while the ui is rendering*) 179 - (* Vars.render_mutex |> Eio.Mutex.lock; *) 180 179 update_status ~cause_snapshot:true () 181 - (* Vars.render_mutex |> Eio.Mutex.unlock *) 182 180 done; 183 181 ()); 184 182 let$* running = Lwd.get ui_state.view in
-2
jj_tui/bin/main.ml
··· 36 36 let prev_term_width, prev_term_height = Lwd.peek Vars.term_width_height in 37 37 if term_width <> prev_term_width || term_height <> prev_term_height 38 38 then Lwd.set Vars.term_width_height (term_width, term_height); 39 - (* Vars.render_mutex |> Eio.Mutex.lock; *) 40 39 Nottui.Ui_loop.step 41 40 ~process_event:true 42 41 ~timeout:0.01 ··· 55 54 loop () 56 55 ;; 57 56 58 - (*TODO:For hosting a subprocess i should look into using EIO and Ui_loop.step like some of the other libraries built with nottui*) 59 57 let start_ui () = 60 58 (*initialse the state*) 61 59 let term = Notty_unix.Term.create () in
+1 -1
jj_tui/widget-test/dune
··· 1 1 (executable 2 2 (public_name widget_test) 3 3 (name main) 4 - (libraries jj_tui nottui base stdio eio_main eio-process ) 4 + (libraries jj_tui nottui base stdio ) 5 5 )