Post by Helmut HaberzettlI think you might have misunderstood Hubert's question. I have the same
question. I've puzzled over it for a while, but couldn't find anything
in the documentation.
We don't want to hide the application console, but we'd like to know
which command we need to terminate the application in the console, i.e.,
the same thing that happens when one mouse-clicks on the red X in the
top toolbar of the console frame (the button that produces the balloon
message "Terminate Application" when the cursor hovers over it).
(1) Is there a shortcut for "Terminate Application"?
(2) Is there a macro function (similar to clicking the red X) that does
terminate the application, which one can use in customized macros?
There is a macro TerminateProcess; that can be put in the menu and
assigned a shortcut of your choice. Defaults do (and will) NOT
provide a shortcut because this macro should not be used unless
something went badly wrong and the application refuses to respond
(it is pretty much the same as killing the process from Windows
Task Manager [or using the infamous "kill -9" command on UNIX]).
Clicking on the "red X" (or Alt+F4) in Windows Console is just as
bad and unsafe...
If a process is killed in this manner you will occasionally:
1. Experience "locked" output files next time you try to run the
compiler (you will have to restart WinEdt or Windows to release
them)
2. Some resources will be wasted each time you terminate process in
this fashion (restarting WinEdt or Windows will be required to
release them).
3. You can get Access Violation (if the application was terminated
in a particularly delicate state) and WinEdt can sometimes be
terminated as well since the call originated from within it.
4. Output files will be corrupted. This may not look like a concern
(since you are about to fix the error and recompile). However,
should latex start reporting "run away arguments" because the
contents of aux files (which will be loaded next time) was not
flushed when the process was killed in a previous run and the files
are in unpredictable state: do not panic. I receive a few "urgent"
reports like this every month (and that is a few too many!). You
will have to find and erase the problematic aux files (and possibly
other corrupted files created during "killed" compilation). Some
users rename the source file or move it to another folder (after
they try to reinstall MiKTeX and WinEdt a few times -- to no avail,
of course:-).
Knowing and understanding this (and no, it is not a bug in WinEdt)
I don't use this method of killing a process on a regular basis
(even if the odds for above problems to occur are pretty low and
resource leaks on a powerful enough machine may be undetectable).
Thus I don't need a shortcut for it...
However, if that's what you want to do: WinEdt's Cancel Shortcut
(by default Shift+ESC) will kill the process in the console. And
you can use TerminateProcess; macro and assign a shortcut of your
choice to this action. Note that you must first shift focus from
console (by default ESC key) before the shortcuts in the menu
become effective.
Responding by "x" (or "e" or "q" etc...) when prompted by TeX (as
suggested by Antonio) is not the same as killing TeX from outside.
This IS a "proper (very different) way" of terminating TeX (giving
it a chance to release and cleanup whatever needs to be done before
exiting)...
This being said, whatever works for you is fine with me (as long as
I don't have to deal with the consequences). Happy TeXing:-)
Best regards,
alex