[issue35217] REPL history is broken when python is invoked with cmd /c

Eryk Sun report at bugs.python.org
Thu Nov 29 17:03:56 EST 2018


Eryk Sun <eryksun at gmail.com> added the comment:

The Windows console has a fixed number of history buffers. In Windows 7 the default maximum is four history buffers. In this case, if we run a script via cmd.exe -> py.exe -> python.exe, then only one history buffer remains for a child process. As you've observed, no history buffer is available for the fifth process if we run cmd.exe -> python.exe. 

You can increase the default maximum in the console's Alt+Space+D defaults dialog, under "Command History" -> "Number of Buffers". This corresponds to the "NumberOfHistoryBuffers" value in the registry key "HKCU\Console". 

You can increase the maximum for the current window in the console's Alt+Space+P properties dialog. If the current console was allocated by an application that was launched from a shortcut (i.e. a .LNK file), this property gets persisted in the shortcut itself. Otherwise it gets persisted in a registry key under "HKCU\Console" that's named for the startup window title. If no title was specified, the default title is the path to the executable, with backslashes replaced by underscore and the Windows directory as %SystemRoot%. For example, if you run cmd.exe from the Win+R run dialog, its console properties are stored in the registry key "HKCU\Console\%SystemRoot%_system32_cmd.exe".

----------
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35217>
_______________________________________


More information about the Python-bugs-list mailing list