According to https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html it's OK for readline() to return multi-line strings and/or newlines in case of bracketed paste (enabled by default since readline 8.1) and also in other situations even though its documentation explicitly states the opposite. So we need to handle this properly in calc instead of just using the first line and dropping the rest: Split the string returned by readline() into lines and return line by line with each invocation of hist_getline(), each possbily adding a terminating newline.
Fix for #138
According to https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html it's OK for readline() to return multi-line strings and/or newlines in case of bracketed paste (enabled by default since readline 8.1) and also in other situations even though its documentation explicitly states the opposite. So we need to handle this properly in calc instead of just using the first line and dropping the rest: Split the string returned by readline() into lines and return line by line with each invocation of hist_getline(), each possbily adding a terminating newline.