[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Small workspace of an example from "APL in Exposition" cor

From: Juergen Sauermann
Subject: Re: [Bug-apl] Small workspace of an example from "APL in Exposition" corrupts keyboard input after reload
Date: Mon, 17 Feb 2014 14:45:41 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Jean-Pierre,

I believe I found the reason for this problem, see SVN 132.

When the workspace is )LOADed or )COPYed and ⎕NLT is assigned.
Assigning ⎕NLT calls setlocale(), which in turn seems to mess up libreadline.

As of SVN 132:

* ⎕NLT is not assigned when )LOADing a workspace,
* when assigning ⎕NLT I call setlocale only if its value has changed,
* after calling setlocale() I call rl_initialize().

/// Jürgen

On 02/16/2014 04:39 PM, ds.jaypee wrote:
Hi Jürgen,

I've successfully tried this ugly workaround, it heals the symptom, not the cause...
In Workspace.cc/Workspace::load_WS()
   // got open file. We assume that from here on everything will be fine.
   // clear current WS and load it from file
   the_workspace.clear_WS(CERR, true);
   Input::init(); ///////////////// Kludge alert ! /////////////
   return Workspace::get_LX();

Le 15/02/2014 20:06, Juergen Sauermann a écrit :
Hi Jean-Pierre,

I have debugged the matter a little further.

It seems like the readline library sometimes skips too few characters.

For example, after entering


and then recalling the line and deleting the last character with Backspace,
the new line should be:


However, it is actually ∇C[⎕] plus the first two bytes of the trailing ∇ (which has
3 bytes in UTF8 encoding). So the backspace only deletes the last byte instead of the last char.

I have no explanation yet why this occurs only after )LOADing a workspace.

As a short-term work-around I am now discarding the last char and print a short message,
rather than Assert()ing, see SVN 126. The behavior on my machine seems to be somewhat
different from yours.

I have put the issue on my mid-term TODO list. It could be that I have to remove
use of libreadline completely, which takes a while.

/// Jürgen

On 02/12/2014 09:07 PM, ds.jaypee wrote:
Hallo Jürgen,
I confirm that the crash is resolved.
However, the APL input corruption is still present.
Basically after reload, you cannot type any new APL character

Here is a screen dump, in case you cannot reproduce it in your environment:
Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]