-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
read clears last line if it doesn't end with a new line #12296
Copy link
Copy link
Open
Description
fish, version 4.3.3
Kernel: Linux 6.12.63-1-lts
Terminal: Alacritty
The issue happens even without third-party customizations (sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= XDG_DATA_DIRS= fish')
This issue would not happen before 4.3.
If you use read in a line that contains text, for example after echo -n, read will clear that line's text and put itself at the first column of that line.
For example:
echo -n 'Press ENTER to continue...' && read --prompt-str ''Before 4.3, it would print Press ENTER to continue... and put the cursor at the end (| bellow symbolizes the cursor):
Press ENTER to continue...|
In 4.3, that line's text is erased by read and output becomes:
|
It happens even without --prompt-str:
echo -n 'Press ENTER to continue...' && readread> |
(Yes, I know there are better ways to use read, but this is not the expected behavior nevertheless)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels