Python and EOF

Richard Tobin richard at
Tue Mar 23 17:24:24 UTC 2021

Is it possible to make python behave correctly when the user's EOF
character is not set to control-D?  It works fine on Linux, but not
with the macports on the Mac.

For historical reasons I have control-Z as my EOF character.  But
typing it in python results in it being suspended rather than
exiting.  Typing control-D just echoes ^D.

As I understand it, this is because python in macports uses libedit
(aka editline) rather than readline.  Readline adjusts the key
bindings to match the user's stty settings, but libedit doesn't.

Does anyone have a workaround for this?

-- Richard

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

More information about the macports-users mailing list