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.

finished nottui picos

+28 -24
+5 -3
forks/nottui/lib/nottui/nottui_main.ml
··· 1092 1092 term 1093 1093 root 1094 1094 = 1095 + Printf.eprintf "running step\n"; 1095 1096 let size = Term.size term in 1096 1097 let image = 1097 1098 if (not (Lwd.is_damaged root)) && !cache |> Option.is_some ··· 1104 1105 (* If we are already damaged then we should re-calculate*) 1105 1106 if Lwd.is_damaged root then stabilize () else image 1106 1107 in 1107 - stabilize ()) 1108 + stabilize () 1109 + 1110 + ) 1108 1111 in 1109 1112 cache := Some image; 1110 1113 Term.image term image; ··· 1122 1125 (* let has_event =Term.pending term in *) 1123 1126 if wait_for_event () 1124 1127 then ( 1125 - Printf.eprintf "getting term event\n"; 1126 1128 match Term.event term with 1127 1129 | `End -> () 1128 1130 | `Resize _ -> () ··· 1184 1186 ?term 1185 1187 ?(renderer = Renderer.make ()) 1186 1188 ?quit 1187 - ?(quit_on_escape = true) 1189 + ?(quit_on_escape = false) 1188 1190 ?(quit_on_ctrl_q = true) 1189 1191 t 1190 1192 =
+7 -20
forks/nottui/lib/nottui_picos/nottui_picos.ml
··· 10 10 let step computation in_fd = 11 11 Ui_loop.Internal.step ~await_read:(fun _ timeout -> 12 12 let rec select () = 13 - Printf.eprintf "waiting on events\n"; 14 - computation := Ivar.create (); 15 - let cancelEvent = Ivar.read_evt !computation in 16 13 let ret = 17 14 Event.select 18 15 [ Picos_io_select.on in_fd `R |> Event.map (fun x -> `Ready) 19 - ; Picos_io_select.on in_fd `W |> Event.map (fun _ -> `Ready) 20 - ; cancelEvent 21 - |> Event.map (fun x -> 22 - Printf.eprintf "rerun-invalidation\n"; 23 - `LwdStateUpdate) 24 - ; Picos_io_select.timeout ~seconds:10.0 25 - |> Event.map (fun x -> `NotReady) 16 + (* This doesn't seem to be needed *) 17 + (* ; Picos_io_select.on in_fd `W |> Event.map (fun _ -> `Ready) *) 18 + ; Event.from_computation !computation |> Event.map (fun _ -> `LwdStateUpdate) 26 19 ] 27 20 in 28 - Printf.eprintf "finished waiting\n"; 21 + Printf.eprintf "done waiting\n"; 29 22 ret 30 - (* match Picos_io.Unix.select [ in_fd ] [] [ in_fd ] timeout with *) 31 - (* | [], [], [] -> `NotReady *) 32 - (* | _ -> `Ready *) 33 - (* | exception Unix.Unix_error (Unix.EINTR, _, _) -> select () *) 34 23 in 35 24 select ()) 36 25 ;; ··· 45 34 then Picos_io.Unix.stdin 46 35 else Picos_io_fd.create ~dispose:false in_fd 47 36 in 48 - let trigger = ref (Ivar.create ()) in 37 + let trigger = ref (Computation.create ()) in 49 38 let step = step trigger in_picos_fd in 50 39 a := !a + 1; 51 40 Ui_loop.Internal.run_with_term 52 - ~on_invalidate:(fun _ -> 53 - Printf.eprintf "invalidated\n"; 54 - Ivar.fill !trigger ()) 41 + ~on_invalidate:(fun _ -> Computation.finish !trigger;) 55 42 ~step 56 43 term 57 44 ;; 58 45 59 - let run = Ui_loop.Internal.run ~run_with_term 46 + let run = Ui_loop.Internal.run ~run_with_term ~tick_period:100.0 60 47 end
-1
forks/nottui/lib/nottui_picos/nottui_picos.mli
··· 41 41 42 42 val run 43 43 : ?on_invalidate:(ui -> unit) 44 - -> ?tick_period:float 45 44 -> ?tick:(unit -> unit) 46 45 -> ?term:Term.t 47 46 -> ?renderer:Renderer.t
+16
todo.md
··· 21 21 - This allows for way less idle usage 22 22 - This allows us to support selection 23 23 - Currently we cannot select becasue the terminal is constatnly re-rendering, I could fix that now probably, but the picos change would also fix it 24 + 25 + 26 + ## Allow single threading support to also behave the same way 27 + I can make this work single threaded as well. 28 + Instead of using async await. 29 + 1. use a very small timeout in unix.select/ polling 30 + 2. on_invalidate set the invalidate flag true 31 + 3. Re-render when it's been set to true 32 + 33 + 34 + ## locking issues 35 + Currently we have an issue with lwd and locking. 36 + Basically we want to observe all invalidation that isn't processed already 37 + - Nottui will reprocess the node before rendering if it's already invalid 38 + - Lwd has oninvalidate but it runs event lwd.set that is being delayed because we are during recomputation. 39 + I want to capture all invalidation between the last call to stabalize in nottui and the next event whether that be a invalidation event or a keypress