Page MenuHomePhabricator

Under "cmd.exe" in Windows, "^C" causes "arc.bat" to annoyingly prompt the user "Terminate batch job? [Y/N]"
Open, LowPublic

Description

If you Ctrl+C a batch job (even on the last line) then it asks you "Terminate batch job?" which is very annoying. The answer is also saved to the command line history (so it seems that you executed command y). Killing the job from outside (e.g. Ctrl+Pause in SciTE) results in a still running zombie process of the underlying command (php in our case) until it tries to print something when it dies.

I've discovered some alternatives but they all seem as dead ends:

  • *.cmd is just another name for *.bat on newer Windows.
  • PowerShell is not available everywhere.
  • *.js files (executable by CScript) have to be run with the extension (e.g. arc.js).

The only solution I see is to create arc.exe which seems like ridiculous overkill.

Revisions and Commits

Event Timeline

vrana triaged this task as Low priority.Mar 20 2013, 9:08 AM
vrana added projects: Arcanist, Windows.
vrana added subscribers: vrana, AnhNhan.

We can just patch cmd.exe as part of the install process, I'm sure no one will mind:

http://itsme.home.xs4all.nl/projects/misc/patching-cmdexe.html

Lol, this really is an overkill. I think I'll just learn some language suitable to create light-weight .exe files over time, and pack it up.

There's a way how to make arc work by itself. There's an environment variable PATHEXT used for running commands without extension. If we convince user to put .php in it and associate *.php files with PHP interpreter then we can put this file in bin\:

arc.php
<?php
include dirname(__FILE__)."/../scripts/arcanist.php";

It's quite involved but it still seems better than EXE file. We can use arc.bat as fallback.

Hm, I think we can condense both into something like a arc intall-win command. The environment can be set with [[http://www.codeproject.com/Articles/12153/SetEnv|SetEnv.exe]] and the association...
I don't remember how to do the latter but it should be doable from CLI (hack ourselves a phpassoc.reg in the worst case). Ok, finding PHP on PATH to do it automatically could be a problem, since we do not have which php like UNIX nor getenv('php.home') like Java.

I had fun doing the exe though :P

We can use where php on Windows.

... arc install-win, I'm on the way!

chad changed the visibility from "All Users" to "Public (No Login Required)".Jan 14 2015, 12:16 AM
epriestley renamed this task from Replace arc.bat with something better to Under "cmd.exe" in Windows, "^C" causes "arc.bat" to annoyingly prompt the user "Terminate batch job? [Y/N]".Oct 3 2018, 2:52 PM