This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, keeely
Date 2021-11-22.20:18:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637612316.8.0.751861091491.issue45870@roundup.psfhosted.org>
In-reply-to
Content
> The Windows cmd implementation clearly uses readline or 
> some compatible lib under the hood

The REPL shell and input() call PyOS_Readline(). If this call isn't hooked (e.g. by the readline module), and stdin is a console file, then it reads a line from the console via ReadConsoleW(). If the console's input stream is configured in line-input mode, which we assume it is, this function provides basic readline-ish support, including a line editor that supports input history and aliases. The history is stored in an in-memory buffer in the console, which doesn't get save and reused across console sessions. There is no public API to get the history contents, and there is no support at all to set it. 

The console/terminal team at Microsoft apparently don't want to do anything with the builtin readline support, which is seen as a legacy feature. To the contrary, I've even seen them suggest that they're evaluating the addition of a new client-side readline library in the native API, which I assume would be similar to PowerShell's PSReadLine (e.g. based on ReadConsoleInputW(), and supporting a classic console mode in addition to emacs and vi modes).

For now, I suggest patching pyreadline for your own use. In the reported issue, I see it's trying to use collections.Callable. Instead it should import collections.abc and use collections.abc.Callable.
History
Date User Action Args
2021-11-22 20:18:36eryksunsetrecipients: + eryksun, keeely
2021-11-22 20:18:36eryksunsetmessageid: <1637612316.8.0.751861091491.issue45870@roundup.psfhosted.org>
2021-11-22 20:18:36eryksunlinkissue45870 messages
2021-11-22 20:18:36eryksuncreate