Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation WATCH Command Does Not Exit with Ctrl-C

Jun
760
16
I was just playing around with the WATCH command, which I've never used in the past (I'm trying to find a way to display the contents of a folder whenever a new file appears), and I got trapped in the command. Ctrl-C had no effect. Fortunately, ESC did cause the command to terminate.

In addition, the command did not work as I expected using either the example in the help or a version that would change even less often: watch /c /v "echo date = %%_date". The screen flashes very rapidly and displays the same date each time. Am I misunderstanding what this command is supposed to do?

In any case, either the documentation should be changed to say only the ESC ends the command, or the command should be changed so that Ctrl-C does terminate it.
 
The example works for me.

I added the /F option;
Code:
watch /c /v /f "(echo time=%%_time & echo date=%%_date)"
1732728068454.webp


Ctrl-C broke out of it for me.

Esc did not break out of it for me.

Joe
 
Working here, where I tried the following;
Code:
watch /c /v /f "(dir r:\ /b)"

When I added a new file to drive R:\,
the "Press any key when ready..." was presented.

When I deleted that new file from drive R:\,
the "Press any key when ready..." was presented.

Ctrl-C was my method to exit.

Joe
 
I was just playing around with the WATCH command, which I've never used in the past (I'm trying to find a way to display the contents of a folder whenever a new file appears), and I got trapped in the command. Ctrl-C had no effect. Fortunately, ESC did cause the command to terminate.

In addition, the command did not work as I expected using either the example in the help or a version that would change even less often: watch /c /v "echo date = %%_date". The screen flashes very rapidly and displays the same date each time. Am I misunderstanding what this command is supposed to do?

In any case, either the documentation should be changed to say only the ESC ends the command, or the command should be changed so that Ctrl-C does terminate it.

For a command like that, you probably really want to add the /In option to specify how many seconds to wait before running the command again. Otherwise, you're going to be running that command in a loop as fast as TCC can manage it (i.e., every few milliseconds).

^C works here to break out of the command.
 
Thanks, Rex. Yes, the /i2 option slowed things down. Perhaps the example in the help should be updated.

For me, Ctrl-C still does not work, and I tried using both Ctrl keys on my keyboard. ESC continues to work.

How can I make it so that nothing appears on the screen until something has changed? The WATCH command keeps updating but marks what is different. I would like the screen to update only after a file has been added to the directory (in my case, when a scan has produced a new file).
 
Ah, I just tried running watch in a detached TCC session. There the Ctrl-C works. It fails in a TCMD tab.
 
Here, Ctrl-C works in a TCMD tab too.
 
Now I see that this is a very general problem. TCMD seems to be swallowing all Ctrl-C keypresses. Ctrl-Break works. This happens only in Take Command, not in a standalone TCC session.

Any idea what configuration setting I've got wrong?
 
Thank you, Rex!!! Yes, that was it. I thought that I had copied all of my keyboard shortcuts, including Ctrl-C for copying. I just removed that, and Ctrl-C now functions as a break. And it can still be used to copy selected text to the clipboard.

Now, can you come up with the solution to the position and size of the help window? It can't be a system-wide issue, such as a locked registry, because I don't have the problem in the earlier versions. I even tried version 30 just now to make sure that it wasn't only 32 that worked.
 
Back
Top