mainThe GNU Readline library - Support: sr #110845, Possible regression in 8: Empty...


sr #110845: Possible regression in 8: Empty input with empty prompt fails to echo final newline

Submitter:  B. Wilson <eiyizuushi>
Submitted:  Mon 27 Feb 2023 03:24:08 PM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 05 Sep 2023 07:39:19 PM UTC, comment #2: 

This was fixed back in November, 2022, the result of

The fix is in the readline devel branch.

Chet Ramey <chet>
Group administrator
Wed 01 Mar 2023 04:36:22 PM UTC, comment #1: 

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

B. Wilson <eiyizuushi>
Mon 27 Feb 2023 03:24:08 PM UTC, original submission:  

## 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;


    $ example
    + ''

Expected output:

    $ example

    + ''

B. Wilson <eiyizuushi>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by eiyizuushi (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-09-05 chet StatusNone Done

    Back to the top

    Powered by Savane 3.13-c54d.
    Corresponding source code