Is watch in FreeBSD 8 Stable broken?

Hi!

I discovered the following behavior while using watch:
Code:
#watch pts/2
everithing ok, try to reconnect(Ctrl+x):
Code:
Snoop device change by user request.
Enter device name [/dev/pts/2]:
watch: fatal: cannot attach to tty

I tryed to write pts/2, /dev/pts/2 ect., but no success. Google doesn't help me in this question.

Does anybody knows how to fix this error?
 
Does it work if you use TTY values, instead of PTS values? watch ttyv1 for example. Just curious if it's actually been updated to work with the PTS system.
 
# watch /dev/pts/0 works fine here on FreeBSD 8.0-STABLE #0: Tue Jan 5 15:08:55 CET 2010..
 
DutchDaemon said:
# watch /dev/pts/0 works fine here on FreeBSD 8.0-STABLE #0: Tue Jan 5 15:08:55 CET 2010..
yes, watch /dev/pts/0 does work
What about reconnect to tty after user request (Ctrl+X)?
 
phoenix said:
Does it work if you use TTY values, instead of PTS values? watch ttyv1 for example. Just curious if it's actually been updated to work with the PTS system.

Problem not in watch ttyv1, impossible to recnnect to snoop device after user request:
Code:
Snoop device change by user request.
Enter device name [/dev/ttyv0]:
watch: fatal: cannot attach to tty
 
val said:
yes, watch /dev/pts/0 does work
What about reconnect to tty after user request (Ctrl+X)?

The usual:

Code:
Snoop device change by user request.
Enter device name [/dev/pts/0]: [I][enter][/I]
watch: fatal: cannot attach to tty

Arrow up, enter, and we're back in.
 
DutchDaemon said:
The usual:

Code:
Snoop device change by user request.
Enter device name [/dev/pts/0]: [I][enter][/I]
watch: fatal: cannot attach to tty

Arrow up, enter, and we're back in.

Arrow up here generate ^[[A and nothing happened. :\
BTW, shell is tcsh (if it's important):
Code:
Snoop device change by user request.
Enter device name [/dev/ttyv0]:^[[A
watch: fatal: bad device name
 
No, arrow up after the 'fatal' error, when you're returned to the shell. Well, I am returned to the shell anyway ...

SO:

Code:
Snoop device change by user request.
Enter device name [/dev/pts/0]: [B][I][enter][/I][/B]
watch: fatal: cannot attach to tty
[return to shell prompt]
[arrow up = last command] [enter]
 
lol. Yes, the workaround is simple, but it doesn't change the fact that there is a bug in the watch utility. It either needs to be fixed or the reconnect feature needs to be removed.

To the OP, you could start watch with "-n" to disable the reconnect/switch feature.
 
funny watch was buggy in 7.0 as well, I guess the dev's dont use watch as they manage to bug it in two x.0 releases in a row now.
 
You could nag ed@ if he can take a look at it. He was the last one who touched watch.c and eats tty code for breakfast. :)
 
Back
Top