summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2002-07-14 14:08:43 +0000
committerluigi <luigi@FreeBSD.org>2002-07-14 14:08:43 +0000
commit0a62a25a0897dfad2f20bbc0ae962f31f6c9776b (patch)
tree63a7f7e188dee3e5f39571b55ec4eb9e63b1c633 /usr.bin/talk
parent662958d09e5330297b21e10b9472f7276909ab12 (diff)
downloadFreeBSD-src-0a62a25a0897dfad2f20bbc0ae962f31f6c9776b.zip
FreeBSD-src-0a62a25a0897dfad2f20bbc0ae962f31f6c9776b.tar.gz
Clear local screen when ^D is typed.
Use setproctitle to remove arguments from 'ps' output. MFC after: 3 days
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/display.c12
-rw-r--r--usr.bin/talk/talk.113
-rw-r--r--usr.bin/talk/talk.c1
3 files changed, 24 insertions, 2 deletions
diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c
index 7bdf38e..789467e 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 3ef99d8..654893c 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 0b15e24..bea31fb 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();
OpenPOWER on IntegriCloud