[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-readline] Readline echoing on non-terminal input
From: |
Ken Hornstein |
Subject: |
[Bug-readline] Readline echoing on non-terminal input |
Date: |
Thu, 22 Mar 2012 12:21:38 -0400 |
I've recently added readline to one of the applications that I work
on. This went fine. But I started getting reports from other
developers that the application was failing the test suite, but it
didn't do that for me.
What we eventually figure out was this:
- The test suite failure was because our test suite did this:
echo "some input" | application
and now as part of the output we would get back "some input" in the
output. This wasn't expected, so the test suite checks failed.
- It worked for me because I was using readline 5, but the other developers
were using readline 6.
- What I eventually tracked it down to was the code in rl_prep_terminal
in rltty.c. The code tries to check the settings of the input
terminal but if it fails with certain errors then it always turns
on echoing. The key difference is that the call to check the
terminal settings fails with EINVAL, and that wasn't checked for
in readline 5 but it is checked for in readline 6.
So I guess my questions are:
- Is echoing supposed to be turned on when the input is not a tty?
I would have thought "no", but it seems like a concious decision
was made here to turn it on.
- Is there a way to get consistent echoing behavior when using readline 5
and readline 6? I can live with one behavior (although I'd prefer
to have it turned off to match the non-readline test case) as
long as it's the same between readline versions. It seems like
the right APIs aren't exposed to make it work.
--Ken
- [Bug-readline] Readline echoing on non-terminal input,
Ken Hornstein <=