Closed nkh closed 1 year ago
@nkh
I have tried your revised version, and the effect is very good. It support editing it again.Use your implementation
The command box really creates an infinite number of possibilities
Please help update the document, and must tell the user the details.
For an example of a command box combined with an external tool, we may need to document it as a topic to help users use it better.
I think this part already belongs to the advanced usage of asciio, and it is extremely efficient to use it well
exec add lines There is a small bug that needs to be fixed
When the user does not have any input directly click OK, the program will hang
Good catch but that's not a bug, if the command requires input it will wait for it; it's a user error.
But your point is valid, I've added a timeout for all commands, it's set to 2 seconds for now, running the code that adds line will now fail and display this message.
Can't execute 'nl -n ln -w 2 -s' ' 2>&1 ':
output:
error:
[31744]
I also have added #44 to make the dialogs more usable
@qindapao I just committed 65bcb73, the exec boxes are refactored, use a larger dialog, and there's some documentation in mdbook.../stencils/asciio_exec_box.
@qindapao
please check this work, I've added these four stencils so they can be reached via the popup
'Asciio/Boxes/exec' 'Asciio/Boxes/exec verbatim' 'Asciio/Boxes/exec verbatim once' 'Asciio/Boxes/exec add lines'
the documentation is in stencils/asciio_exec_box
the simplest way to use them is via the bindings I have also added
if all is good for you we can close this ticket
@nkh
It is much more valuable than my implementation, I like it very much, please close issuee.
@qindapao you have implemented the code-box but I think these points could be better
we already have 2 types of command boxes
I have implemented in a933d8adea6280cfea6ba041e801471f2967eed4 a new type of command box, one that takes command verbatim. try it and let me know if you think it's a good replacement for the code box (how often do you use it?)
I had to change the implementation of the exec box a bit because the old version would run each line as a separate command, the new one takes the command verbatim.
it also can take a start command, here is how they are added to the stencils
We still have the possibility for a user input that looks like the code-box but I'd rather have it use the above mechanism for execution.