Skip to content

prompt_toolkit 3.0.25+ breaks Ctrl-C #33428

@tornaria

Description

@tornaria

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(54853908712446157179434453567343931596301333824416758692208077566613224454501131209)
^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: prompt-toolkit/python-prompt-toolkit#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)

Upstream: Reported upstream. No feedback yet.

CC: @antonio-rojas @orlitzky @jhpalmieri

Component: packages: standard

Keywords: prompt_toolkit

Author: Matthias Koeppe

Branch/Commit: bd1bc04

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/33428

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions