···2525 ; cmd =
2626 Fun
2727 (fun _ ->
2828- ui_state.show_popup $= Some (commands_list_ui ~include_arrows:true command_mapping, "Help");
2828+ ui_state.show_popup
2929+ $= Some (commands_list_ui ~include_arrows:true command_mapping, "Help");
2930 ui_state.input $= `Mode (fun _ -> `Unhandled))
3031 }
3132 ; {
···174175 ; cmd =
175176 SubCmd
176177 [
177177- { key = 'p'; description = "git push"; cmd = Cmd [ "git"; "push" ] }
178178+ {
179179+ key = 'p'
180180+ ; description = "git push"
181181+ ; cmd =
182182+ Fun
183183+ (fun _ ->
184184+ let log =
185185+ jj_no_log [ "git"; "push"; "--dry-run" ]^"hi\n"
186186+ |> AnsiReverse.colored_string
187187+ |> Ui.atom
188188+ |> Lwd.pure
189189+ in
190190+ ui_state.show_popup $= Some (log, "Git push will:");
191191+ let subcmd =
192192+ {
193193+ key = 'y'
194194+ ; description = "proceed"
195195+ ; cmd = Cmd [ "git"; "push" ]
196196+ }
197197+ in
198198+ ui_state.input $= `Mode (command_input ~is_sub:true [subcmd]))
199199+ }
178200 ; { key = 'f'; description = "git fetch"; cmd = Cmd [ "git"; "fetch" ] }
179201 ]
180202 }
···223245 Cmd [ "branch"; "delete"; branch ]
224246 |> confirm_prompt
225247 (Printf.sprintf
226226- "delete the branch: '%s' This will also delete it on \
227227- the remote next \"git push\"."
248248+ "delete the branch: '%s' This will also delete it on the \
249249+ remote next \"git push\"."
228250 branch))
229251 }
230252 ; {
···238260 Cmd [ "branch"; "forget"; branch ]
239261 |> confirm_prompt
240262 (Printf.sprintf
241241- "orget the branch: '%s' . This will not delete it on \
242242- the remote."
263263+ "orget the branch: '%s' . This will not delete it on the \
264264+ remote."
243265 branch))
244266 }
245267 ; {
+2
jj_tui/bin/jj_commands.ml
···262262 let confirm_prompt prompt cmd =
263263 SubCmd [ { key = 'y'; description = "Yes I want to " ^ prompt; cmd } ]
264264 ;;
265265+ (** Handles raw command mapping without regard for modes or the current intput state. Should be used when setting a new input mode*)
266266+ let command_input=command_input;;
265267266268 (** Handles input and sub_commands.*)
267269 let handleInputs command_mapping =