Subject: bug#33403: [Geiser-users] bug#33403: Data length limit in Guile/Geiser/Scheme evaluation

From: "Jose A. Ortega Ruiz" <[email-masked]>
Date: Fri, 16 Nov 2018 23:12:32 +0000

On Fri, Nov 16 2018, Neil Jerram wrote:

> Neil Jerram <[email-masked]> writes:
>
>> Mark H Weaver <[email-masked]> writes:
>>
>>> This is a documented limitation in Linux's terminal handling when in
>>> canonical mode.  See the termios(3) man page, which includes this text:
>>>
>>>    Canonical and noncanonical mode
>>>        
>>>        The setting of the ICANON canon flag in c_lflag determines
>>>        whether the terminal is operating in canonical mode (ICANON set)
>>>        or noncanonical mode (ICANON unset).  By default, ICANON is set.
>> [...]
>>>        * The maximum line length is 4096 chars (including the
>>>          terminating newline character); lines longer than 4096 chars
>>>          are truncated.  After 4095 characters, input processing (e.g.,
>>>          ISIG and ECHO* processing) continues, but any input data after
>>>          4095 characters up to (but not including) any terminating
>>>          newline is discarded.  This ensures that the terminal can
>>>          always receive more input until at least one line can be read.
>>>
>>> Note that last item above.
>>
>> Awesome; thank you Mark.
>>
>> So possibly this limit can be removed, in my Org/Geiser context, by
>> evaluating (system* "stty" "-icanon") when initializing the Geiser-Guile
>> connection.  I'll try that.  Will the terminal that that 'stty' sees be
>> the same as Guile's stdin?
>>
>> Jao, if that works, I wonder if it should be the default for Geiser?  It
>> appears to me that Geiser shouldn't ever need the features of canonical
>> mode.  Is that right?
>>
>> Anyway, I'll see first if the stty call is effective.
>
> Yes, with this in my ~/.guile-geiser -
>
> (system* "stty" "-icanon")
>
> - I can do evaluations past the 4K line length limit, and the Org-driven
> problem that I first reported [1] has disappeared.

Ah, system* is a scheme call! So yeah, maybe we could add that call to
Geiser's guile initialization... i don't really see how that would cause
any problem elsewhere.

> Thanks to Nicolas, Jao and Mark for your help in understanding this.

And thanks to Nicolas, Mark and you for yours :)

Cheers,
jao
-- 
The vast majority of human beings dislike and even dread all notions with
which they are not familiar. Hence it comes about that at their first
appearance innovators have always been derided as fools and madmen.
 -Aldous Huxley, novelist (1894-1963)