bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] .apl.history file?


From: Juergen Sauermann
Subject: Re: [Bug-apl] .apl.history file?
Date: Thu, 21 Jul 2016 12:15:10 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi David,

the reason for this behavior is that copying (possibly huge) apl scripts into the history is
somewhat annoying because that information is already contained in the scripts themselves.

The decision if the input is interactive or not is based on the return value of C function tcgetattr.
If that function returns no error then an interactive session is assumed (and the history is written at
the end of the session).

Please note that this decision only affects the writing of the history file at the end of a session (so that
the history will survive and be available in the next session) but not the history itself. That means that
)HISTORY or ⍎")HISTORY" should work even if the session is fed by a pipe.

/// Jürgen


On 07/20/2016 05:34 PM, David B. Lamkins wrote:
Thanks, Jürgen.

I see what's happening now: The history file is not enabled when input is from a pipe, which is the case when I run akt|apl. The history file works as expected when input is from a terminal.

I guess I should finally get around to rewriting akt to use forkpty(). :)



On Wed, Jul 20, 2016 at 12:40:41PM +0200, Juergen Sauermann wrote:
Hi David,

yes, it is in place (despite of its name which was not changed when readline
was removed, so
that existing preferences files would still work).

Maybe you want to check with apl -l 37 in which order the preferences files are
read.

You can also modify the LineInput constructor like this to see what filename is
being used:

LineInput::~LineInput()
{
   if (initial_termios_errno)   return;

Q(write_history)
Q(uprefs.line_history_path.c_str())
...


/// Jürgen



On 07/20/2016 04:11 AM, David B. Lamkins wrote:

    Is the history file mechanism still in place?

    I have set READLINE_HISTORY_PATH in ~/.gnu-apl/preferences to /home/dlamkins/.apl.history .

    GNU APL doesn't create the history file, nor does it write to the file if I create it.





    


reply via email to

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