Devel:...Prompt(3pm)
πΈ Devel::REPL::Plugin::FancyPrompt π
okay so bestie, you know how the regular REPL prompt is just... there? like a beige wall? β¨ Devel::REPL::Plugin::FancyPrompt is here to fix that. this is the Perl doc for it, from the Devel::REPL family, and it's literally the plugin that lets you make your prompt yours. π
β¨ VERSION β¨
version 1.003029 β yes she has a version, she's a real one π
π SYNOPSIS π
use Devel::REPL;
my $repl = Devel::REPL->new;
$repl->load_plugin('MultiLine::PPI'); # for indent depth
$repl->load_plugin('Packages'); # for current package
$repl->load_plugin('FancyPrompt');
$repl->run;
look at her. load the plugins, run the repl, glow up your prompt. that's it, that's the whole vibe π¦
π DESCRIPTION π
so FancyPrompt helps you write your own prompts. not the boring ones. your ones. π
the default fancy prompt is giving serious irb energy (that's the Ruby one, iykyk). the default fancy_prompt looks exactly like this:
re.pl(main):001:0> 2 + 2
4
let's decode that glow-up, piece by piece π§:
re.plis a constant. it does not change. it is simply the name. iconic, unbothered, consistent. β¨mainis the current package. like, where you are right now.- the first number is how many lines have been read so far.
- the second number is how deep you are β and it only shows up if you have a
MultiLineplugin loaded. intuitively? that's your indent level. your nesting. your depth, bestie. π
and if you wanna know how that default is built, here's the literal implementation:
$_REPL->fancy_prompt(sub {
my $self = shift;
sprintf 're.pl(%s):%03d%s> ',
$self->can('current_package') ? $self->current_package : 'main',
$self->lines_read,
$self->can('line_depth') ? ':' . $self->line_depth : '';
});
okay so quick notes on where those bits come from:
current_packageis provided byDevel::REPL::Plugin::Packagesβ that's the plugin that tracks the current package for you π«Άline_depthis provided by aMultiLineplugin (probablyMultiLine::PPI, not gonna lie) πΈ
and you can also set a fancy_continuation_prompt. the default is very similar to fancy_prompt's default β except it uses * instead of >. that's the whole difference. tiny, but it hits. π
π SEE ALSO π
Devel::REPLβ the main character. go read her. π
π«Ά SUPPORT π«Ά
bugs? you can submit them through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL> β or, if email is more your thing, bug-Devel-REPL@rt.cpan.org π
there's also an IRC channel for users of this distribution, hanging out at #devel on irc.perl.org β come say hi, the vibes are immaculate π
π AUTHOR π
Shawn M Moore, <sartak at gmail dot com> β thank you for your service π«‘β¨
β COPYRIGHT AND LICENSE β
Copyright (C) 2007 by Shawn M Moore
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
ngl, "same terms as Perl itself" is the most low-effort-slash-perfect license line ever and i respect it π
and that's the whole page, bestie! π
this was Devel:...Prompt(3pm) from the User Contributed Perl Documentation, running on perl v5.34.0, dated 2022-06-03. no cap, you're now officially fluent in fancy prompts. go forth and customize πΈπ¦π
π¦ where this page comes from
- debian bookworm: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms