Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 571 forks source link

Question: Input a promt response in macro #2332

Closed MikeKholomeev closed 3 years ago

MikeKholomeev commented 3 years ago

Hi, I have a macro like print("\esome command with parameters\n"). As you may see - this macro puts a text and presses Enter to execute it. During the execution of the entered command, it creates a prompt: waiting for user response.

Can I put that response in macro as well? for example letter "y" and then press "Enter".

Maximus5 commented 3 years ago

Have you tried just to append "y" after the "\n"?

MikeKholomeev commented 3 years ago

Yes, I've tried. It enters "y" in the console after "some_command" finished execution.

MikeKholomeev commented 3 years ago

if it helps - this command is "docker system prune --volumes"

Maximus5 commented 3 years ago

I'm not sure what do you mean. print acts exactly the same way if you type the same characters in the console. Don't you say the behavior is different?

MikeKholomeev commented 3 years ago

Yes, exactly. https://monosnap.com/file/4TQaH1Hu1qiqgSYfCwEAeTyOHr9urq

Maximus5 commented 3 years ago

Looks like Docker creates it's own input handle. And your "y" goes to original input handle. Try to add Sleep function: https://conemu.github.io/en/GuiMacro.html#Sleep

e.g. ... parameters\n"); Sleep(2000); print("y\n")

MikeKholomeev commented 3 years ago

Perfect! Thanks! It helps! Added sleep 200 and it works ))))