VTPRINTCAP(5)

✨ VTPRINTCAP ✨

ok so bestie, welcome to the vtprintcap manual page πŸ’– this is the File Formats Manual section, and honestly? it's giving "tiny database, big responsibility" πŸ‘‘


🌸 NAME 🌸

vtprintcap β€” the database of terminal printer control codes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

/etc/vtprintcap

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so vtprintcap is literally just a simple flat file database, no cap. it's got a list of the names of various terminals, plus the codes those terminals use to start and stop an attached printer (that's media hard copy, bestie πŸ–¨οΈ). this database gets used by vtprint(1) and its related programs. it's the whole vibe.

every entry is made of three lines, periodt:

  1. the first line is a comma-delimited list of names you can use to reference this entry πŸ‘―
  2. the second line is the sequence of characters the terminal uses to turn ON an attached hard copy device and redirect output to that device
  3. the third line is the sequence of characters used to turn the device OFF and restore normal output to the screen

an entry must have all three lines to count as valid. no partial entries, no half-sends, we don't do that here πŸ™…

⚠️ and currently, no comment lines are permitted to exist between these lines! if you sneak one in there, it gets interpreted as the printer control codes themselves. like, it will literally be read as the codes. do not do this bestie i am begging 😭

the rules for picking a terminal name are simple: you have to follow the same rules as for /etc/termcap(5) names. terminal names should be entered in /etc/vtprintcap with exactly the same names as they are in /etc/termcap. matching names, matching energy, that's the rule ✨

now, the control code strings in the second and third lines of an entry are governed like this: ANSI C style escapes for character constants (like \n for newline) are permitted βœ…, constant strings are permitted βœ…, and quotes may be used as delimiters in the string βœ…. (this one is a lifesaver if you wanna use a digit immediately following a numeric escape. for example, ESC-5 should be represented as \033"5" to avoid confusion with \335. the quotes are doing so much work there honestly πŸ’…). in general, the rules outlined for ANSI constant escaping are enforced.

and additionally β€” plot twist 🎬 β€” /etc/vtprintcap may contain comment lines, which you indicate by placing a hash mark (#) in the first column of the line. but remember: entries must not be broken up by comment lines! 🚨 do not split the trio, the trio is sacred.


πŸ’– EXAMPLE πŸ’–

here's a sample entry that's common to DEC vt100 and vt102 terminals, iconic behavior truly πŸ‘‘

# Sample vtprintcap entry for vt100 & vt102 terminals
vt100, vt102
\033[5i
\033[4i

this entry would get used whenever the user's TERM environment variable was set to "vt102" or "vt100", using ESC [5i and ESC [4i as the printer control codes to turn a printer on and off, respectively. see how it works? chef's kiss 🀌


🌈 DISTRIBUTION 🌈

vtprintcap is part of the vtprint package, which you can get by anonymous ftp at ftp.sdsu.edu in the /pub/vtprint directory πŸ›°οΈ please read the INDEX and README files before downloading, fr fr. they're there for a reason.

if you do not have ftp availability, then you can request a uuencoded copy of vtprint be sent to you via e-mail from the author πŸ“§. the author is also willing to make other arrangements as needed, within certain limitations. very generous, very demure πŸŽ€


πŸ“ FILES πŸ“

  • /etc/termcap
  • /etc/vtprintcap

πŸ’€ BUGS πŸ’€

ok so the vtprintcap handling code currently could get confused if a printer control code is exactly the same as the name of a terminal, or if it contained the name of a terminal delimited by commas πŸ˜΅β€πŸ’«

as this is very unlikely to ever occur, it shouldn't be a problem. lowkey chilling, highkey fine 🫢


⭐ SEE ALSO ⭐


and that's the whole page bestie!! πŸ’– this was vtprint v2.0.2, dated 25 October 1994 β€” yeah she's vintage, she's a classic, she predates most of us and she still slays πŸŽ€βœ¨ go forth and configure your printers, ily, bye πŸ‘‹πŸ’