Running a script with cyradm throwing ReadLine errors

Binarus lists at binarus.de
Tue Dec 18 03:07:40 EST 2018


Dear ellie,

thank you very much for your help!

On 17.12.2018 23:57, ellie timoney wrote:
> Hi Binarus,
> 
>> Could anybody please tell me what I might do wrong here?
> 
> This kind of smells like maybe your system has two versions of perl installed (or two versions of Term::ReadLine, or maybe even two versions of Cyrus::IMAP::Shell), and they're getting in each other's way?

Since this is a fresh installation of Debian stretch, and since I didn't
compile or install anything by hand yet, and since the Debian package
management is usually very reliable, I am quite sure that this is not
the problem.

> Which... fills me with confidence.  Looks like a workaround for missing (broken?) Term::Readline but that comment isn't super enlightening.  I wonder if it will Just Work if you uninstall Term::Readline?

This idea is very interesting, and you are absolutely right!

While I didn't want to remove Term::ReadLine itself (because it is a
core module and the usual module uninstall tools have difficulties with
uninstalling it), I removed Term::ReadLine:Gnu (which I had additionally
installed) instead. This made the error go away, and it seems that I can
execute scripts now.

So you have provided the solution and solved the problem.

However, there is a downside. I am using cyradm quite often, mainly for
setting permissions in a large shared folder (i.e. public) hierarchy.
For this reason, I really need the nice feature which bash and many
sorts of other shells provide: Hit the "Cursor-Up" key and have the
shell repeat the previous command; the ability to edit the command line
is often associated with this.

Obviously, we can't have this feature in cyradm when only Term::ReadLine
is installed. When this is the case, I even can't use "Cursor-Left" or
"Cursor-Right" keys because they only produce weird character sequences
instead of moving the cursor.

This was the reason why I installed Term::ReadLine::Gnu in addition to
Term::ReadLine. When Term::ReadLine:Gnu is installed, the command
history feature in cyradm works as expected, and I can edit the command
line (including using cursor keys) in a reasonable manner.

Now it looks that I can either run scripts with cyradm _or_ can have its
command line history and editing, but not both features at the same
time. I think I could live with that, but of course I would be grateful
if somebody would share a method to enable both features.

Perhaps there is another module which I could use as a replacement for
Term::ReadLine::Gnu and which does not break scripting?

Thank you very much again,

Binarus


More information about the Info-cyrus mailing list