
use Zoidberg::Shell qw/:all/;

# set environment
%env = (
	EDITOR	=> 'vim',
	MAILER	=> '',
	PAGER	=> 'less',
	BROWSER	=> 'lynx',
#	PS1	=> '[\u@\h(\L) \W]',
);
$ENV{$_} ||= $env{$_} for keys %env;

# Some programs expect this var to point to a fully posix compliant shell.
# Since zoid doesn't use this var, no harm is done.
# Notice that even perl core utils like perldoc have expectations about it.
$ENV{SHELL} = '/bin/sh';

# set aliases
alias( {
	ls       => 'ls --color=auto',
	ll       => 'ls --color=auto -l',
	up       => 'cd ..',
	bye      => 'exit',
	( ($> == 0) # root gets other aliases
		? ( perldoc => 'perldoc -U', perlfunc => 'perldoc -Uf' )
		: ( perlfunc => 'perldoc -f' )
	),
} );

# set default settings
# set( );

__END__

TODO for PS1

['[',{color=>'red'}],
['\u',{color=>'magenta'}],
['@',{color=>'blue'}],
['\h',{color=>'green'}],
['(\L)',{color=>'yellow',if=>'sub{my$s=$self->stringify;$s=~s{\e.*?m}{}g;if($s=~/\d/){return 1} else { return 0 }}'}],
' ',
['\W',{color=>'cyan'}],
[']',{color=>'red'}],
' ',
],

