From 8aed91ca2d46abbb70b137563a0854f53eec779c Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Sun, 14 Jul 2002 14:08:43 +0000 Subject: [PATCH] Clear local screen when ^D is typed. Use setproctitle to remove arguments from 'ps' output. MFC after: 3 days --- usr.bin/talk/display.c | 12 ++++++++++++ usr.bin/talk/talk.1 | 13 +++++++++++-- usr.bin/talk/talk.c | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c index 7bdf38ea8c84..789467ee0271 100644 --- a/usr.bin/talk/display.c +++ b/usr.bin/talk/display.c @@ -85,6 +85,18 @@ display(win, text, size) text++; continue; } + if (*text == 004 && win == &my_win) { + /* control-D clears the screen */ + werase(my_win.x_win); + getyx(my_win.x_win, my_win.x_line, my_win.x_col); + wrefresh(my_win.x_win); + werase(his_win.x_win); + getyx(his_win.x_win, his_win.x_line, his_win.x_col); + wrefresh(his_win.x_win); + text++; + continue; + } + /* erase character */ if ( *text == win->cerase || *text == 010 /* BS */ diff --git a/usr.bin/talk/talk.1 b/usr.bin/talk/talk.1 index 3ef99d875f3b..654893cfe699 100644 --- a/usr.bin/talk/talk.1 +++ b/usr.bin/talk/talk.1 @@ -90,10 +90,19 @@ of the message should reply by typing It doesn't matter from which machine the recipient replies, as long as his login-name is the same. Once communication is established, the two parties may type simultaneously, with their output appearing -in separate windows. Typing control-L +in separate windows. +Typing control-L .Ql ^L will cause the screen to -be reprinted, while your erase, kill, and word kill characters will +be reprinted. +Typing control-D +.Ql ^D +will clear both parts of your screen to be cleared, while +the control-D character will be sent to the remote side +(and just displayed by this +.Nm +client). +Your erase, kill, and word kill characters will behave normally. To exit, just type your interrupt character; .Nm then moves the cursor to the bottom of the screen and restores the diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c index 0b15e24ab7f8..bea31fb0a7a5 100644 --- a/usr.bin/talk/talk.c +++ b/usr.bin/talk/talk.c @@ -74,6 +74,7 @@ main(argc, argv) (void) setlocale(LC_CTYPE, ""); get_names(argc, argv); + setproctitle(""); check_writeable(); init_display(); open_ctl();