NAME

Zoidberg::Fish::Log - History and log plugin for Zoidberg

SYNOPSIS

This module is a Zoidberg plugin, see Zoidberg::Fish for details.

DESCRIPTION

This plugin listens to the 'prompt' event and records all input in the history log.

If multiple instances of zoid are using the same history file their histories will be merged.

TODO option for more bash like behaviour

In order to use the editor feature of the fc command the module File::Temp should be installed.

EXPORT

None by default.

CONFIG

loghist

Unless this config is set no commands are recorded.

logfile

File to store the history.

maxlines

Maximum number of lines in the history. If not set the environment variable 'HISTSIZE' is used. In fact the number of lines can be a bit more then this value on run time because the file is not purged after every write.

no_duplicates

If set a command will not be saved if it is the same as the previous command.

keep

Hash with log types mapped to a number representing the maximal number of lines to keep in memory for this type. In contrast to the commandline history, history arrays for these types are completely managed by this module.

COMMANDS

fc [-r][-e editor] [first[last]]
fc -l [-nr] [first [last]]
fc -s [old=new] [first [last]]

TODO this command doesn't work yet !

Note that the selection of the editor is not POSIX compliant but follows bash, if no editor is given using the '-e' option the environment variables 'FCEDIT' and 'EDITOR' are both checked, if neither is set, vi is used. ( According to POSIX we should use 'ed' by default and probably ignore the 'EDITOR' varaiable. )

Following zsh setting the editor to '-' is identical with using the -s switch.

history [--type type] [--read] [-n|--nonu] [-r|--reverse] [first [last]]

Returns (a part of) the history. By default it tries to find the commandline history (depending on GetHistory), but the '--read' option forces reading the history file. To get other log types, like 'pwd', use the '--type' option. The '--nonu' option surpressees line numbering for the terminal output.

The arguments first and last can either be a positive or negative integer, representing the command number or reverse offset, or a string matching the begin of the command. If only one integer is given last defaults to '-1'; if only one string is given last defaults to first. As a bonus you can supply a regex reference instead of a string when using the perl interface.

Note that unlike fc the history command is not specified by posix and the implementation varies widely for different shells. In zoid, fc is build on top of history, so options for history are chosen consistently with b<fc>.

log string type

Adds string to the history file with the current timestamp and the supplied type tag. The type defaults to "log". If the type is set to "hist" the entry will become part of the command history after the history file is read again.

AUTHOR

Jaap Karssenberg (Pardus) <pardus@cpan.org>

Copyright (c) 2003 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Zoidberg