Project

General

Profile

Bug #1029

Readline: does not recognize interrupts

Added by John Abbott about 7 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
enhancing/improving
Target version:
Start date:
14 Mar 2017
Due date:
% Done:

100%

Estimated time:
2.02 h
Spent time:

Description

Justin C Walker has pointed out that CoCoA-5's current use of readline does not recognize interrupts (e.g. Ctrl-C).

Improve the implementation so that interrupts are recognized.


Related issues

Related to CoCoA-5 - Bug #1028: Readline: cursor moves wrongly when at start of line with a promptClosed2017-03-13

Related to CoCoA-5 - Bug #1624: CantStop playing CantStopNew2021-10-21

Related to CoCoA-5 - Feature #1479: CoCoA release for linux: CoCoAInterpreter: with and without libreadline?Closed2020-08-07

History

#1 Updated by John Abbott about 7 years ago

A quick search found the following example use of the readline alternative interface:
http://www.mcld.co.uk/blog/blog.php?274

Someone on StackOverflow said that this can be adapted to allow signal handling.
http://stackoverflow.com/questions/12290411/interrupting-c-c-readline-with-signals

The documentation on the following site suggests that signal handling should be done automatically by readline:
http://www.delorie.com/gnu/docs/readline/rlman_43.html

Now I'm puzzled.

#2 Updated by John Abbott about 7 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I'm still searching for a "ready-to-eat" solution on the internet, and am also reading the readline documentation.

Anyway, I observe that while Ctrl-C seems to be effectively ignored, the desired effect can be achieved by Ctrl-A Ctrl-K ("goto start of line", "clear rest of line"). So maybe it is not that important to resolve this issue.

#3 Updated by Anna Maria Bigatti almost 7 years ago

  • Related to Bug #1028: Readline: cursor moves wrongly when at start of line with a prompt added

#4 Updated by John Abbott over 3 years ago

  • Assignee set to John Abbott
  • Target version changed from CoCoA-5.?.? to CoCoA-5.4.0
  • % Done changed from 10 to 50

I have just tried it on my Ubuntu box, and it seemed to work fine.

N := factorial(300000);
facs := FactorINT_TrialDiv(N,1000); -- takes a while, so I did ctrl-C

I'll also a few other linux users to verify that it works OK for them. MacOS too.
Maybe Microsoft?

UPDATE Julian reports that interrupts are not recognised on his Ubuntu 20.04 with libreadline.so.8

#5 Updated by John Abbott over 3 years ago

I have asked Julian to run my executable on his Ubuntu machine, and interrupting works; but interrupting did not work with the executable from the official 5.3.2 distribution.
Mysterious!

UPDATE I can report the same behaviour on my computer. Maybe the distributed version includes a "strange" version of libreadline?

#6 Updated by John Abbott over 2 years ago

  • Related to Bug #1624: CantStop playing CantStop added

#7 Updated by John Abbott about 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 80

I suppose we should try to test the Linux executable just before distributing it.
Or should I make the executable on my machine?

I have just tried the example from comment 4, and it is definitely interruptible,

#8 Updated by John Abbott about 2 years ago

  • Related to Feature #1479: CoCoA release for linux: CoCoAInterpreter: with and without libreadline? added

#9 Updated by John Abbott about 2 years ago

Maybe the simplest is to add this to the pre-release checks...?

#10 Updated by John Abbott about 2 years ago

  • % Done changed from 80 to 100
  • Estimated time set to 1.88 h

This works for us now (my Ubuntu box, and Anna on the Linux VM).
We hope this means that the problem has been resolved.
Closing.

#11 Updated by John Abbott about 2 years ago

  • Estimated time changed from 1.88 h to 2.02 h

#12 Updated by John Abbott about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF