NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/52517: TTY settings modified and not restored on exit.



I couldn't find a way to update the bug report directly, so I'm replying by email.  Please let me know if there is a better way.

The before/after tty settings differences only appear if your original settings are different from libedit's defaults.  It turns out that the differences do not show up with xterm (in my environment).  The changes are very noticeable when running an emacs shell.  I've modified the test to highlight the issue regardless of default shell tty settings.

Jay

/*---------------------------------------
* Simple program: tty_test.c
*---------------------------------------*/
#include "editline/readline.h"

int main(int argc, char* argv[]) {
  rl_initialize();
  return 0;
}

/*---------------------------------------
* Compile
*---------------------------------------*/
% gcc -o tty_test -Ilibedit_install/include tty_test.c libedit_install/lib/libedit.a -lncurses

/*----------------------------------------
* Modified test: 
*----------------------------------------*/
% stty -icanon # Force tty settings to be different from libedit default.
% stty -a > orig.txt
% tty_test
% stty -a > after.txt
diff orig.txt after.txt  # Differences exist


On Fri, Sep 1, 2017 at 12:40 AM, Christos Zoulas <christos%zoulas.com@localhost> wrote:
The following reply was made to PR lib/52517; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost,
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc:
Subject: Re: lib/52517: TTY settings modified and not restored on exit.
Date: Fri, 1 Sep 2017 03:35:12 -0400

 On Aug 31,  9:50pm, jhdub23%gmail.com@localhost (jhdub23%gmail.com@localhost) wrote:
 -- Subject: lib/52517: TTY settings modified and not restored on exit.

 | >Number:         52517
 | >Category:       lib
 | >Synopsis:       TTY settings modified and not restored on exit.
 | >Confidential:   no
 | >Severity:       non-critical
 | >Priority:       medium
 | >Responsible:    lib-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Thu Aug 31 21:50:00 +0000 2017
 | >Originator:     Jay West
 | >Release:        libedit (NetBSD-current)
 | >Organization:
 | Self
 | >Environment:
 | Linux [deleted] 2.6.32-696.6.3.el6.x86_64 #1 SMP Wed Jul 12 14:17:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
 | >Description:
 | libedit modifies TTY settings when used, and does not have a mechanism to fully save and restore TTY settings.  This causes problems when libedit is used as a GNU readline replacement.
 |
 | Specifically, after running python+GnuReadline, TTY settings are untouched after python exits.  However, python+libedit has noticeable TTY changes after python exits.
 |
 | This will be true for any application linked against libedit instead of GnuReadline.
 | >How-To-Repeat:
 | % stty -a > orig.txt
 | % python # Run python compiled with libedit, and immediately exit (or any application using libedit).
 | % stty -a > after.txt
 | % diff orig.txt after.txt  # Differences exist
 |


 Can you provide a small program that calls readline and reproduces this?

 christos




Home | Main Index | Thread Index | Old Index