Maximus5 / conemu-inside

An example, how to embed http://conemu.github.io/ into another graphical application
57 stars 42 forks source link

Execute Command Synchronously (aync/await) #35

Open vinaychandra opened 7 years ago

vinaychandra commented 7 years ago

Can we run a command synchronously?

For example, await ExecuteGuiMacroTextAsync returns immediately on executing long running commands. Is there any way to pause await until the current command is run completely?

Maximus5 commented 7 years ago

I don't believe it's ever possible.

DotNet posts GuiMacro to ConEmu; ConEmu tells console server to do something; console server is doing something; console applications may do something. Even if we implement blocking execution in ConEmu chain (which may block some critical things in theory), we have absolutely no guarantee a) when console application would start execution of what you requested in DotNet b) and what is worse, we can't determine the end of that execution.

vinaychandra commented 7 years ago

If we cannot determine the end of the execution, can we do something like, wait until the next input request from the console?

Maximus5 commented 7 years ago

Perhaps yes, but I can't guarantee that. Even if it's possible, I prefer to implement new GuiMacro like WaitForInput instead of making current functions synchronous.

vinaychandra commented 7 years ago

My temporary workaround is either using file locks or ipc. A new GuiMacro would be great!

vmario89 commented 6 years ago

hi, looking for the same thing. i can live we the risk that a process never will give some output so the script won't continue under bad circumstances (because the console may but must do not something). but for some tasks some wait queue command (synchronous) would be really neat.

regards, Mario