Hi,

When upgrading from 8.2.013 -> 8.3.0 on Arch Linux x86_64 I noticed that one of the software that I use, NGSpice[1],  that uses readline stopped working as expected.

In short; NGSpice spawns a prompt and captures the input from the user, however when using readline 8.3.0 there is no input being captured. After testing a bit in their code I found that it's the rl_event_hook that causes the issue.

For testability, the following code snippet has the same interaction as NGSpice uses:

```
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
#include <readline/history.h>

int my_event_hook(void) {
    // NGSpice handles input here, for testing purposes just return 0.
    return 0;
}

int main(void) {
    char *line;

    rl_event_hook = my_event_hook;

    while ((line = readline("prompt> ")) != NULL) {
        if (*line) {
            add_history(line);
            printf("You typed: %s\n", line);
        }
        free(line);
    }

    printf("\nEOF received, exiting...\n");
    return 0;
}
```

Using 8.2.013:  I get the expected prompt and I can handle input as expected.
Using 8.3.0:  I get no input, and readline pegs one of my CPU cores at 100%

I'm no readline user so please let me know if this is a downstream issue or not, so I can report it to the proper channels.

Thanks in advance

With best regards,
Torleif Skår

[1]: https://ngspice.sourceforge.io/


Reply via email to