Map ^C and ^\ (INTR and QUIT) to ^Q so that you can actually send these
guys to a watched process. Useful if you're monitoring someone who's started doing something you'd really like them to stop immediately. :) Suggested by: Phillip White <philw@megasoft.tic.ab.ca>
This commit is contained in:
parent
e075ffc9a7
commit
020539b659
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12887
@ -55,7 +55,7 @@ Names may be preceded by "/dev/".
|
||||
While running in interactive mode, all user input is discarded except for:
|
||||
.Pp
|
||||
.Bl -tag -width "XXXX" -compact
|
||||
.It Sy "<control-C>"
|
||||
.It Sy "<control-Q>"
|
||||
Exit
|
||||
.Nm watch .
|
||||
.It Sy "<control-W>"
|
||||
|
@ -88,13 +88,19 @@ void
|
||||
set_tty()
|
||||
{
|
||||
struct sgttyb sgn;
|
||||
struct tchars tc;
|
||||
|
||||
ioctl(std_in, TIOCGETP, &sgo);
|
||||
ioctl(std_in, TIOCGETC, &tc);
|
||||
/* bcopy(&sgn, &sgo, sizeof(struct sgttyb)); */
|
||||
sgn = sgo;
|
||||
sgn.sg_flags |= CBREAK;
|
||||
sgn.sg_flags &= ~ECHO;
|
||||
ospeed = sgo.sg_ospeed;
|
||||
tc.t_intrc = 17; /* ^Q */
|
||||
tc.t_quitc = 17; /* ^Q */
|
||||
ioctl(std_in, TIOCSETP, &sgn);
|
||||
ioctl(std_in, TIOCSETC, &tc);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user