On Mon, 6 Sep 2021 at 13:53, Andreas Schwab wrote: > On Sep 06 2021, Michael Albinus wrote: > >> Andreas Schwab writes: >> >>>>> Okay, so is the TTY line length limit of the OS available in Lisp >>>>> somewhere? Otherwise, can we at least trust that 1024 is the universal >>>>> lower bound? >>>> >>>> On systems with a POSIX shell: >>>> >>>> (let ((default-directory "/")) >>>> (read (shell-command-to-string "getconf LINE_MAX"))) >>> >>> LINE_MAX has nothing to do with the tty line discipline. >> >> I'll never learn it :-( >> >> We've discussed this issue some years ago already. IIRC, the outcome was >> to use "getconf PIPE_BUF /" instead. > > Neither has PIPE_BUF. > > Andreas. Okay then. Since there seem to be no better alternatives, I have attached a new patch reducing the limit to a hard-coded 1024 bytes. If some day someone adds a variable specifying a more precise limit, then we can change this. I have also rearranged things a bit so that the setup code is sent to the inferior process just once, rather than of on every call to `python-shell-send-string'. This way, the smaller line length limit doesn't increase too much the use of temp files, which, as I mentioned, is slow over ssh. It would be great if someone with access to a BSD-like OS could test this. I can only test locally on Linux and over ssh between Linux machines. PS: I have some more suggestions around the Python shell. Is the ideal workflow to keep creating bugs with a small patch to each improvement, or do you prefer to review a larger collection of changes bundled together?