From sebster@eeyore.sebster.com  Fri Jun  8 12:21:03 2001
Return-Path: <sebster@eeyore.sebster.com>
Received: from eeyore.sebster.com (e163161.upc-e.chello.nl [213.93.163.161])
	by hub.freebsd.org (Postfix) with SMTP id 20CEF37B407
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Jun 2001 12:20:27 -0700 (PDT)
	(envelope-from sebster@eeyore.sebster.com)
Received: (qmail 30069 invoked by uid 1000); 8 Jun 2001 19:19:57 -0000
Message-Id: <20010608191957.30068.qmail@eeyore.sebster.com>
Date: 8 Jun 2001 19:19:57 -0000
From: sebster@sebster.com
Reply-To: sebster@sebster.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: talk feature
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27972
>Category:       bin
>Synopsis:       losing information with talk(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 08 12:30:07 PDT 2001
>Closed-Date:    
>Last-Modified:  Wed May 21 20:56:01 UTC 2008
>Originator:     Sebastiaan van Erk
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Insight Information Technologies
>Environment:
System: FreeBSD eeyore.sebster.com 4.3-STABLE FreeBSD 4.3-STABLE #0: Sat May 26 11:07:12 CEST 2001 root@eeyore.sebster.com:/usr/src/sys/compile/EEYORE i386
>Description:
Using the talk utility it is possible to communicate to other users, however
if they have something to say that is longer than your buffer you lose the
information without any way to check what was said.
>How-To-Repeat:
Say a lot to somebody in a talk window in a short amount of time.
>Fix:
A very simple fix which would make talk about 1000 times more convenient
(IMHO) would be to flip the windows: put "me" in the bottom, and "him" in
the top window. That way, whether you are on the console or in an xterm,
you can scroll back to see what the other person said.
>Release-Note:
>Audit-Trail:

From: Sebastiaan van Erk <sebster@sebster.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/27972: losing information with talk
Date: Fri, 8 Jun 2001 22:46:21 +0200

 Hi,
 
 I patched talk running at home with the following patch to flip the 
 "him" and "me" windows, tested it, and it semes to work.
 
 There also seems to be a bug in init_disp.c with the line (around line 104):
 
         idlok(my_win.x_win, TRUE);
 
 in the block where his_win is initialized... Shouldn't that read "his_win"?
 As is, the original code contains the above statement twice.
 
 Greetings,
 Sebastiaan van Erk
 
 ----------------------------------->8---------------------------------------
 
 diff -c -r talk.orig/init_disp.c talk/init_disp.c
 *** talk.orig/init_disp.c	Fri Jun  8 22:26:26 2001
 --- talk/init_disp.c	Fri Jun  8 22:26:00 2001
 ***************
 *** 90,111 ****
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	my_win.x_nlines = LINES / 2;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 0, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	his_win.x_nlines = LINES / 2 - 1;
   	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols,
 ! 	    my_win.x_nlines+1, 0);
 ! 	idlok(my_win.x_win, TRUE);
   	scrollok(his_win.x_win, TRUE);
   	wclear(his_win.x_win);
   
 ! 	line_win = newwin(1, COLS, my_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 --- 90,111 ----
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	my_win.x_nlines = LINES / 2 - 1;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 
 ! 	    his_win.x_nlines + 1, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	his_win.x_nlines = LINES / 2;
   	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols, 0, 0);
 ! 	idlok(his_win.x_win, TRUE);
   	scrollok(his_win.x_win, TRUE);
   	wclear(his_win.x_win);
   
 ! 	line_win = newwin(1, COLS, his_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 diff -c -r talk.orig/io.c talk/io.c
 *** talk.orig/io.c	Fri Jun  8 22:26:26 2001
 --- talk/io.c	Fri Jun  8 22:14:35 2001
 ***************
 *** 124,133 ****
   p_error(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(my_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 --- 124,133 ----
   p_error(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(his_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 ***************
 *** 140,148 ****
   message(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s]\n", string);
 ! 	if (current_line < my_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(my_win.x_win);
   }
 --- 140,148 ----
   message(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s]\n", string);
 ! 	if (current_line < his_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(his_win.x_win);
   }

From: Sebastiaan van Erk <sebster@sebster.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/27972: losing information with talk
Date: Fri, 8 Jun 2001 23:02:33 +0200

 Hi,
 
 Sorry for my stupidity, but my previous patch was wrong.
 
 Here is the final (and tested) patch.
 
 Greetings,
 Sebastiaan van Erk
 
 --------------------------------->8------------------------------------------
 
 diff -c -r talk/init_disp.c /usr/src/usr.bin/talk/init_disp.c
 *** talk/init_disp.c	Mon Aug 30 10:21:17 1999
 --- /usr/src/usr.bin/talk/init_disp.c	Fri Jun  8 22:55:24 2001
 ***************
 *** 90,111 ****
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	my_win.x_nlines = LINES / 2;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 0, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	his_win.x_nlines = LINES / 2 - 1;
 ! 	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols,
 ! 	    my_win.x_nlines+1, 0);
 ! 	idlok(my_win.x_win, TRUE);
 ! 	scrollok(his_win.x_win, TRUE);
 ! 	wclear(his_win.x_win);
 ! 
 ! 	line_win = newwin(1, COLS, my_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 --- 90,111 ----
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	his_win.x_nlines = LINES / 2;
 ! 	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols, 0, 0);
 ! 	idlok(his_win.x_win, TRUE);
 ! 	scrollok(his_win.x_win, TRUE);
 ! 	wclear(his_win.x_win);
 ! 
 ! 	my_win.x_nlines = LINES / 2 - 1;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 
 ! 	    his_win.x_nlines + 1, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	line_win = newwin(1, COLS, his_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 diff -c -r talk/invite.c /usr/src/usr.bin/talk/invite.c
 *** talk/invite.c	Sat Feb  3 11:27:57 2001
 --- /usr/src/usr.bin/talk/invite.c	Fri Jun  8 22:12:23 2001
 ***************
 *** 127,134 ****
   {
   
   	message("Ringing your party again");
 ! 	waddch(my_win.x_win, '\n');
 ! 	if (current_line < my_win.x_nlines - 1)
   		current_line++;
   	/* force a re-announce */
   	msg.id_num = htonl(remote_id + 1);
 --- 127,134 ----
   {
   
   	message("Ringing your party again");
 ! 	waddch(his_win.x_win, '\n');
 ! 	if (current_line < his_win.x_nlines - 1)
   		current_line++;
   	/* force a re-announce */
   	msg.id_num = htonl(remote_id + 1);
 diff -c -r talk/io.c /usr/src/usr.bin/talk/io.c
 *** talk/io.c	Fri Aug 18 12:24:17 2000
 --- /usr/src/usr.bin/talk/io.c	Fri Jun  8 22:14:35 2001
 ***************
 *** 124,133 ****
   p_error(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(my_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 --- 124,133 ----
   p_error(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(his_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 ***************
 *** 140,148 ****
   message(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s]\n", string);
 ! 	if (current_line < my_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(my_win.x_win);
   }
 --- 140,148 ----
   message(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s]\n", string);
 ! 	if (current_line < his_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(his_win.x_win);
   }

From: Dima Dorfman <dima@unixfreak.org>
To: sebster@sebster.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/27972: talk feature 
Date: Fri, 08 Jun 2001 21:37:24 -0700

 sebster@sebster.com writes:
 > 
 > >Number:         27972
 > >Category:       bin
 > >Synopsis:       losing information with talk
 > >Description:
 > Using the talk utility it is possible to communicate to other users, however
 > if they have something to say that is longer than your buffer you lose the
 > information without any way to check what was said.
 > >How-To-Repeat:
 > Say a lot to somebody in a talk window in a short amount of time.
 > >Fix:
 > A very simple fix which would make talk about 1000 times more convenient
 > (IMHO) would be to flip the windows: put "me" in the bottom, and "him" in
 > the top window. That way, whether you are on the console or in an xterm,
 > you can scroll back to see what the other person said.
 
 In general, I like this, and the second patch you posted looks good
 upon visual inspection.  I haven't had time to investigate it further,
 but already have a few questions:
 
   * Did you actually test that doing this will allow you to scroll up
 and see your party's messages?  I haven't tested it myself, but have
 an eerie feeling that it may not work.
 
   * What do you think of making this new behavior conditional on a
 command-line option?  Some people may not care for this (e.g., they
 only use talk for one or two line communications), but may get annoyed
 at the sudden change of orientation.
 
 Thanks,
 
 					Dima Dorfman
 					dima@unixfreak.org

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Dima Dorfman <dima@unixfreak.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/27972: talk feature
Date: Sat, 9 Jun 2001 14:00:29 +0300

 On Fri, Jun 08, 2001 at 09:40:03PM -0700, Dima Dorfman wrote:
 > The following reply was made to PR bin/27972; it has been noted by GNATS.
 > 
 > From: Dima Dorfman <dima@unixfreak.org>
 > To: sebster@sebster.com
 > Cc: FreeBSD-gnats-submit@freebsd.org
 > Subject: Re: bin/27972: talk feature 
 > Date: Fri, 08 Jun 2001 21:37:24 -0700
 > 
 >  sebster@sebster.com writes:
 >  > 
 >  > >Number:         27972
 >  > >Category:       bin
 >  > >Synopsis:       losing information with talk
 >  > >Description:
 >  > Using the talk utility it is possible to communicate to other users, however
 >  > if they have something to say that is longer than your buffer you lose the
 >  > information without any way to check what was said.
 >  > >How-To-Repeat:
 >  > Say a lot to somebody in a talk window in a short amount of time.
 >  > >Fix:
 >  > A very simple fix which would make talk about 1000 times more convenient
 >  > (IMHO) would be to flip the windows: put "me" in the bottom, and "him" in
 >  > the top window. That way, whether you are on the console or in an xterm,
 >  > you can scroll back to see what the other person said.
 >  
 >  In general, I like this, and the second patch you posted looks good
 >  upon visual inspection.  I haven't had time to investigate it further,
 >  but already have a few questions:
 >  
 >    * Did you actually test that doing this will allow you to scroll up
 >  and see your party's messages?  I haven't tested it myself, but have
 >  an eerie feeling that it may not work.
 >  
 It doesn't work here, unfortunately, at least on a text VTY conversation.
 
 >    * What do you think of making this new behavior conditional on a
 >  command-line option?  Some people may not care for this (e.g., they
 >  only use talk for one or two line communications), but may get annoyed
 >  at the sudden change of orientation.
 >  
 I think this could be accomplished by putting the other's party address
 from which the response (if we initiated a call) was made.
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

From: Michael Tokarev <mjt@tls.msk.ru>
To: sebster@sebster.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/27972: talk feature
Date: Tue, 12 Jun 2001 02:35:54 +0400

 sebster@sebster.com wrote:
 > 
 []
 > >Description:
 > Using the talk utility it is possible to communicate to other users, however
 > if they have something to say that is longer than your buffer you lose the
 > information without any way to check what was said.
 > >How-To-Repeat:
 > Say a lot to somebody in a talk window in a short amount of time.
 > >Fix:
 > A very simple fix which would make talk about 1000 times more convenient
 > (IMHO) would be to flip the windows: put "me" in the bottom, and "him" in
 > the top window. That way, whether you are on the console or in an xterm,
 > you can scroll back to see what the other person said.
 
 Please take a look to e.g. talk in linux's netkit package.  Talk there
 has "slightly" different feature that is "the right thing(TM)" to do
 IMHO: it can scroll both half-windows of its own, using ^P and ^N for
 other window and M-P and M-N for my window.  Don't know how many lines
 it remembers, maybe even all conversation...  I also saw a version of
 talk that displays tiny scrollbars (all in textmode) and allows to
 click to it with a mouse.
 
 BTW, I don't know how to properly respond to such messages and
 gnats... ;)
 
 Regards,
  Michael.
>Unformatted:
