Skip to content

Conversation

frabcus
Copy link

@frabcus frabcus commented Sep 27, 2023

Just importing the standard Python readline module allows editing with GNU readline keys. This is not explicitly documented in click, but is implied by their Changelog.

On Windows, the readline module is not standard. This could be fixed by using pyreadline3 in that case, but that should be a separate change. This change ignores the failure to load readline on Windows.

The import ignores symbol unused error F401 from ruff, as that is by design. The readline module just needs importing to work.

No specific unit tests, as click doesn't process mocks in a way that uses readline.

Just importing the standard Python `readline` module allows editing with
GNU readline keys. This is not explicitly documented in `click`, but is
implied by their Changelog.

On Windows, the `readline` module is not standard. This could be fixed
by using `pyreadline3` in that case, but that should be a separate
change. This change ignores the failure to load `readline` on Windows.

The import ignores unused error from ruff, as that is by design - the
`readline` module just needs importing to work.

No specific unit tests, as `click` doesn't process mocks in a way
that uses `readline`.
@NathanWilliams NathanWilliams mentioned this pull request Oct 28, 2023
@nikitajz
Copy link

nikitajz commented Nov 8, 2023

@frabcus I've quickly reviewed the info about readline, seems that the one I'm missing for navigating and editing the text!
+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants