[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug report
From: |
Sascha Scholz |
Subject: |
bug report |
Date: |
Thu, 06 Nov 2003 12:46:30 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 |
hi all,
first of all, sorry for the crosspost, but i don't know if this is
readline or bash related. since readline is developd along with bash, i
hope that's not too bad. ;-)
i encountered a bug which is happening if a program using libreadline is
invoked in a shell script. this only happens in conjunction with bash
(no problem wich e.g. tcsh).
if the program is killed (or segfaults, which happens sometimes with our
project...) the terminal is broken (no input is displayed) which can
only be repaired with the blind-typed 'reset' command. it happens if the
program is invoked directly or with 'eval', but not with 'exec'.
unfortunately the latter is not feasible for me, because i have to do
some things in the script afterwards.
i attached a small testcase reproducing the bug on my system (redhat
linux 8.0, i686). here's how to do it:
1. compile: g++ -o readline_test readline_test.c++ -lreadline -ltermcap
2. run readline_test.sh
3. from another terminal: killall -KILL readline_test
it would be nice, if this could be fixed since it's pretty annoying for me.
thanks,
sascha
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
int main()
{
char *buf;
while (1) {
buf = readline ("> ");
if (0 == buf)
break;
if (buf[0] != '\0') {
printf ("you typed: %s\n", buf);
}
free (buf);
}
putchar ('\n');
return 0;
}
#! /bin/sh
eval readline_test
- bug report,
Sascha Scholz <=