Bug #1028
Readline: cursor moves wrongly when at start of line with a prompt
Description
Problem reported by Justin C Walker via email.
To exhibit problem: start CoCoA-5 (with readline) in a terminal; type in a simple command (e.g. 1+2;
); now go to start-of-line (by pressing Ctr-A). The cursor is to the left of the prompt -- this is wrong!
Related issues
History
#1 Updated by John Abbott over 7 years ago
As Justin C Walker pointed out, the readline
command can accept a string arg which is printed as the prompt.
Currently CoCoA-5 prints out the prompt separately, then calls readline
with an empty string as arg. This makes readline
think that there is no prompt.
The relevant source code appears to be in LineProviders.C
.
#2 Updated by John Abbott over 7 years ago
- Status changed from New to Resolved
- Assignee set to John Abbott
- Target version changed from CoCoA-5.2.2 to CoCoA-5.2.0 spring 2017
- % Done changed from 0 to 80
I think I have just been lucky (or was it Giovanni's good design?).
I have just edited ReadLineProvider::doReadNextLine
, and it seems to work :-)
Will check in shortly.
#3 Updated by John Abbott over 7 years ago
There is a (minor?) problem on my old MacBook: typing Ctrl-A when the cursor is at the right-end of the line does something a bit strange (moves to a new, apparently empty line with a new prompt, but the text of the previous line is still seen when I press return)
#4 Updated by John Abbott about 7 years ago
- Status changed from Resolved to Closed
- % Done changed from 80 to 100
- Estimated time set to 0.99 h
Closing after about 1 month effectively in feedback.
I hardly ever use the readline interface myself -- almost always use CoCoA-5 inside emacs.
Perhaps Justin Walker will let us know if there are any problems....
#5 Updated by Anna Maria Bigatti about 7 years ago
- Related to Bug #1029: Readline: does not recognize interrupts added