diff -up src/sage/interfaces/maxima.py.orig src/sage/interfaces/maxima.py --- src/sage/interfaces/maxima.py.orig 2022-09-19 16:38:18.000000000 -0600 +++ src/sage/interfaces/maxima.py 2023-01-15 17:05:26.283962150 -0700 @@ -568,7 +568,7 @@ class Maxima(MaximaAbstract, Expect): Expect.__init__(self, name='maxima', prompt=r'\(\%i[0-9]+\) ', - command='{0} -p {1}'.format(MAXIMA, shlex.quote(STARTUP)), + command='{0} --disable-readline -p {1}'.format(MAXIMA, shlex.quote(STARTUP)), script_subdirectory=script_subdirectory, restart_on_ctrlc=False, verbose_start=False, @@ -636,7 +636,8 @@ class Maxima(MaximaAbstract, Expect): # Remove limit on the max heapsize (since otherwise it defaults # to 256MB with ECL). - self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)") + self._sendline(":lisp #+ecl (ext:set-limit 'ext:heap-size 0) #-ecl 0") + self._sendline(':lisp #+gcl (progn (si:readline-off) (setf *error-output* (open "/dev/stderr" :direction :output) *standard-input* (open "/dev/stdin" :direction :input) *standard-output* (open "/dev/stdout" :direction :output))) #-gcl t') self._eval_line('0;') # set random seed diff -up src/sage/interfaces/sage-maxima.lisp.orig src/sage/interfaces/sage-maxima.lisp --- src/sage/interfaces/sage-maxima.lisp.orig 2022-09-19 16:38:18.000000000 -0600 +++ src/sage/interfaces/sage-maxima.lisp 2023-01-15 17:04:33.551095508 -0700 @@ -4,3 +4,8 @@ (setf *prompt-prefix* "") +#+clisp +(setf + *error-output* (open "/dev/stderr" :direction :output) + *standard-input* (open "/dev/stdin" :direction :input) + *standard-output* (open "/dev/stdout" :direction :output))