Skip to content

Commit

Permalink
Trac #33428: prompt_toolkit 3.0.25+ breaks Ctrl-C
Browse files Browse the repository at this point in the history
For the record, Ctrl-C is broken starting with version 3.0.25 of
prompt_toolkit (current version 3.0.28 still broken, sage-the-
distribution bundles 3.0.22 so it's ok).
{{{
$ xbps-query -s python3-prompt_toolkit
[*] python3-prompt_toolkit-3.0.28_1 Python3 library for building
powerful interactive command lines
$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5, Release Date: 2022-01-30                     │
│ Using Python 3.10.2. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: factor(54853908712446157179434453567343931596301333824416758692208
077566613224454501131209)
^C^C^C^C
}}}
If one waits the half hour or so that it takes to factor the number
above, then the `^C` gets through, but waiting kind of defeats the
purpose of hitting `^C`. This is not specific to factoring -- anything
that depends on cysignals for Ctrl-C working is broken.

Upstream issue: https://github.com/prompt-toolkit/python-prompt-
toolkit/issues/1576

In the GH issue there are two different fixes suggested (with patches),
IMHO the second one is better for sage (the downside is that introduces
a dependency on cysignals, but sage already depends on cysignals).

No action is needed now, but one of the patches will be necessary
if/when prompt_toolkit is updated, or for distro packages on systems
with a recent version of prompt_toolkit (void linux issue and discussion
in void-linux/void-packages#35730)

URL: https://trac.sagemath.org/33428
Reported by: tornaria
Ticket author(s): Matthias Koeppe
Reviewer(s): John Palmieri
  • Loading branch information
Release Manager committed Jul 24, 2022
2 parents 79ed9e5 + bd1bc04 commit 067a66c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/pkgs/prompt_toolkit/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
prompt_toolkit >=3.0.5
# https://trac.sagemath.org/ticket/33428 - prompt_toolkit 3.0.25+ breaks Ctrl-C
prompt_toolkit >=3.0.5, <3.0.25

0 comments on commit 067a66c

Please sign in to comment.