bug-readline
[Top][All Lists]
Advanced

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

Possible regression in 8: Empty input with empty prompt fails to echo fi


From: eiyizuushi
Subject: Possible regression in 8: Empty input with empty prompt fails to echo final newline
Date: Mon, 04 Sep 2023 09:11:32 +0900
User-agent: mblaze/1.2

Hello,

I reported this issue to the Savannah issue tracker about 6 months ago, but
just found out about the mailing list:

    https://savannah.gnu.org/support/?110845

Apologies if I'm mixing up tracker usage. I'm unclear on what's active and
what's not. Anyway, for convience I'm copying the text of that issue below:


## Overview

I believe this is a regression in version 8. When calling readline("") or
readline(0), and only hitting Return at the prompt, the final newline is not
echoed to the terminal.

Version 7 does echo the newline as expected.


## Example

    /* example.c */
    #include <stdio.h>
    #include <readline/readline.h>

    int main(void) {
        char *line = readline("");
        printf("+ '%s'\n", line);
        return 0;
    }

Output:

    $ example
    + ''
    $

Expected output:

    $ example

    + ''
    $


If your shell is linked against readline 8, then setting PS1='' should manifest
the issue as well.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]