Term::Title(3pm)
π Term::Title π
okay bestie, so this is the Term::Title page from the User Contributed Perl Documentation section (that's the 3pm part, iykyk) and it's literally just a portable API to set your terminal titlebar. no cap. let's get into it π«Ά
β¨ VERSION β¨
version 0.09 β yes queen, that's the one
πΈ SYNOPSIS πΈ
use Term::Title 'set_titlebar', 'set_tab_title';
set_titlebar("This goes into the title");
set_titlebar("Title", "And also print this to the terminal");
set_tab_title("This goes into the tab title");
set_tab_title("Tab Title", "And also print this to the terminal");
π¦ DESCRIPTION π¦
Term::Title gives you one clean abstraction for setting the titlebar or the tab title, no matter what kind of terminal you're in. it's giving "write once, vibe everywhere" π
for *nix terminals, it prints the appropriate escape sequences to set the terminal or tab title based on the value of $ENV{TERM}. on Windows, it uses Win32::Console to set the title directly. iconic behaviour, honestly.
currently, changing the titlebar is supported in these terminals:
- xterm
- rxvt
- screen
- iTerm2.app
- Win32 console
and the terminals that support changing the tab title include:
- iTerm2.app
π USAGE π
β set_titlebar
set_titlebar( $title, @optional_text );
sets the titlebar to $title, or clears the titlebar if $title is undef. dramatic but valid.
on terminals that require printing escape codes to the terminal, a newline character is also printed to the terminal. and if @optional_text is given, it gets printed to the terminal before that newline. so basically, to keep your terminal output cleaner, use set_titlebar() in place of a print() statement and you set the titlebar and print in one go. multitasking queen π
if the terminal is not supported, set_titlebar silently continues β no error, no drama β and just prints @optional_text if any. shy but polite.
π« set_tab_title
set_tab_title( $title, @optional_text );
has the exact same semantics as set_titlebar, but it changes the tab title. that's it. that's the whole thing. π§
π SEE ALSO π
Win32::Console- <http://www.ibiblio.org/pub/Linux/docs/HOWTO/Xterm-Title>
π©· SUPPORT π©·
π Bugs / Feature Requests
please report any bugs or feature requests through the issue tracker at <https://github.com/dagolden/Term-Title/issues>. you will be notified automatically of any progress on your issue β so you'll never be left on read π
π¦ Source Code
this is open source software. the code repository is available for public review and contribution under the terms of the license.
<https://github.com/dagolden/Term-Title>
git clone https://github.com/dagolden/Term-Title.git
π AUTHOR π
David Golden <dagolden@cpan.org>
π CONTRIBUTORS π
- Alexandr Ciornii <alexchorny@gmail.com>
- Pedro Melo <melo@simplicidade.org>
- Slobodan MiΕ‘koviΔ <slobodan@miskovic.ca>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2008 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's a wrap, bestie π this page ships with perl v5.36.0 and was dated 2022-12-12 β slay, go forth and title your terminals π«Άβ¨
π¦ where this page comes from
- debian bookworm: libterm-title-perl 0.09-2 Β· Apache-2.0
- debian trixie: libterm-title-perl 0.09-2 Β· Apache-2.0
- ubuntu noble: libterm-title-perl 0.09-2 Β· Apache-2.0
- ubuntu resolute: libterm-title-perl 0.09-2 Β· Apache-2.0
- ubuntu stonking: libterm-title-perl 0.09-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms