Closed huyz closed 1 month ago
Technical notes: under the hood, supporting the pause module implies to support Display.prompt_until
, a method that takes 5 arguments:
The first three arguments are already ok in my working directory.
interrupt_input
and complete_input
were designed with a tty in mind and translating them to a TUI requires some care:
interrupt_input
could become an "Interrupt" push-button, a suitable replacement for ctrl+c
, which is no longer available to Ansible;\r
and \n
in complete_input
could become a new push-button.Applied to the pause
module, that would leave us with one input field and three buttons: "Interrupt", "A" and "C" (respectively "Abort" and "Continue").
These buttons should ideally appear right under the input field. The input field is not always necessary, but there is no proper way to tell. There are various approaches to that:
get-answer
output?extending inputquestion so it offers optional push-buttons.
I chose this way. Specifically, I introduced a question
widget that combines the abilities of inputquestion
and buttonquestion
:
widget \ feature | input field | buttons |
---|---|---|
inputquestion | yes | no |
buttonquestion | no | at least 1 |
question | Yes | at least 1 |
That should help me implement this feature request.
I have implemented and pushed prompt_until()
:
Your example looks like this:
This feature should land in the next release.
Wow, that's awesome! Bien joué!
This feature is now available as part of Moulti 1.14.0.
@xavierog Tested and it works great.
Btw, is there a keyboard shortcut to get my cursor inside the prompt's textbox?
Btw, is there a keyboard shortcut to get my cursor inside the prompt's textbox?
Not in 1.14.0. But I have just pushed a commit (in the devel
branch) that implements Ctrl+t and Ctrl+y, which jump to the previous/next unanswered question.
Following up on the discussion at https://github.com/xavierog/moulti/discussions/6#discussioncomment-10094741 :
I have some Ansible playbooks that won't run properly because of interactive prompts from the builtin Ansible module pause.
Example:
The problem I get is:
This is separate from supporting interactivity for Ansible's
vars_prompt
feature (support for which was added in v1.13.0)