Term::Title(3pm)

πŸ“¦
version 0.09 Β· 2 versions
  • 0.09 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.09 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 🌈


🩷 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>

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