Stop vim from flashing command prompt in Windows? - windows

Vim under win32 opens a command prompt (vimrun.exe actually, which opens in a terminal window) on every external command, silent or not. Yes, the terminal closes automatically, but it is still quite annoying.
This makes plugins that make extensive use of external commands, such as syntastic (it runs a command on buffer open/save), a real pain.
Is there some way to fix this behavior? What I want is for the terminal to open only for non-silent commands.

Rather than just ![windows command] you might try:
!start /min [windows command]
Alternatively, if you define a shortcut to a windows app you can click on the shortcut's properties and set it up to run as 'Minimized' rather than as 'Normal'
In both cases above an app button will show up on taskbar as the app is opened, as there would be for any minimized application. But it's less intrusive than having an actual window open.
NOTE The !start command solution runs the command asynchronously, resumes Vim immediately without waiting for the command to complete, which may often not be what you want. In that case the use of shortcut set up to run as minimized is better solution.

Just to bring closure: I wrote a replacement runner utility for Vim on Windows that doesn't open a visible command prompt. Here it is: vimrun-silent.

Related

How can I start the Windows Terminal maximized by default?

Is there a way to force the Windows Terminal to start maximized (not full-screen - I still want my taskbar to be there) by default?
If you mean the new Windows terminal (preview), that is possible with adding:
"launchMode": "maximized"
to the "globals" section
Source: Windows Terminal Preview 1910 Release
In addition to what #Petar said, since preview v.1.1.1671.0, --fullscreen and --maximized are two optional switches for the wt execution alias if you're automating something and trying to run the terminal maximized only sometimes.
So, these two ways of launching the terminal from the command line are now an option:
wt --maximized
wt --fullscreen

Terminal window with running command

Is it possible to start a new window of terminal as in Windows: start example.bat? It opens a new window and runs an command.
You can do this using the open command, or ossascript. Here are some related questions using those commands in their answers:
Programmatically launch Terminal.app with a specified command (and custom colors)
Running a command in a new Mac OS X Terminal window
What arguments does the Mac's Terminal.app accept?
The open command is more straightforward, allowing you to specify the name of a script or command to be run, as noted in one answer. That describes this case (referring to open(1)):
open -a Terminal.app file
where file is the application to be opened. You may have to give its full pathname. The manual describes also a --args option which it states can be used to pass parameters to the application.

Keep Windows command window open

I'm running a command through the Windows shell- an existing command window (cmd.exe). When I execute the command, the window closes, even though it's a freestanding window not tied to the command.
How can I keep the window open to see the output?
You can't simply start a child cmd session because it'll share same window and if your custom tool actively closes its window (I wonder why) then it'll close your console and output will disappear.
There isn't much you can do if a program want to close console window but you can at least save its output to a file (to be inspected later with type). If you're working with that console and you don't want to close it then you can use start cmd to execute it in a new console window. Like this:
start cmd /c tool -args ^> output.txt
tool output will be available in output.txt after it finished.
It appears that the executable is closing the command window. Here is what you could try, may work. open a command shell. In the shell issue "cmd" and open another command shell. Run your executable in the newly opened command shell. You nested cmd will be exited, but you may still be able to see some of the output of your executable.

Lazarus on Windows: Why the extra terminal window?

I built a Lazarus GUI application using Ubuntu and then took it onto Windows to compile. On Ubuntu I run it from the terminal like this:
./prg arg
It runs fine using the argument arg passed to it. On Windows this is what I did:
Create shortcut to exe
Edit shortcut and include the argument.
To run on Windows, I run the shortcut.
It works fine but there's an additional terminal window opening behind the application, when I run the shortcut. When the application exits, the window closes with it. The terminal window is empty.
On Windows, before compiling I had to uncheck the -WG switch in compiler options. This was because althought the app is GUI-based, there is a simple routine that checks for the argument passed at command line and uses Writeln to output a message if there were errors.
My key question is why is this terminal window coming up on Windows and how do I get rid of it or suppress it?
Thanks!
(1) Make sure you have set {$APPTYPE GUI} in your code. Otherwise there will be always a "terminal" opened on windows.
(2) Maybe you are confusing a "real" shortcut (*.lnk) with cmd/batch file? The latter also opens a terminal that dies when the lauched app closes.

Close the command prompt window programmatically

I have a set of commands in batch file which is used to run the JAR file.It is working perfectly.
After running the program, the command prompt window doesn't get closed. If I manually close the window, then the application closes as well.
So I want to close the command window without affecting the application.
thanks in advance.
Either use exit or make a new method to go to and have nothing in it. The exit way is better though. :)
My psychic debugging powers tell me you're launching the JAR file using a java command instead of a javaw command.
Use javaw instead and the command window will close when the batch file exits.

Resources