#1028485 bc: Ctrl+C does not clear the buffer

Package:
bc
Source:
bc
Description:
GNU bc arbitrary precision calculator language
Submitter:
Krzysztof Aleksander Pyrkosz
Date:
2023-01-11 19:45:04 UTC
Severity:
normal
Tags:
#1028485#5
Date:
2023-01-11 19:42:36 UTC
From:
To:
Dear Maintainer,

bc in the interactive mode keeps the contents of the previous line after
hitting Ctrl+C. Example:

Type 111, hit Ctrl+C, type 1+1. Expected output is 2. Observed result:

111^C
(interrupt) use quit to exit.
1+1
1112

The performed calculation is 1111+1, definitely now what the user wants
(imagine a shell like bash not clearing the line after Ctrl+C).

There is another very annoying bug #932490 that prevents exiting with
Ctrl+D after Ctrl+C (which is common to all shells and itneractive
application I am aware of). It is also caused by the fact that the line
is not cleared after Ctrl+C.