FILTERM(1)

πŸ“¦
version 1.8 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

filterm β€” filter terminal input and/or output πŸ’… (yes bestie, this is FILTERM(1), the Linux User's Manual page, and it's giving retro-but-iconic)


🌸 SYNOPSIS 🌸

filterm INPUT OUTPUT [COMMAND [ARGS]]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the whole vibe is: filterm executes the COMMAND you hand it (and if you don't hand it one, it just runs the shell β€” default behaviour, no drama), and while that's happening it filters the terminal input and/or output. periodt ✨

why would you even want this? because sometimes your terminal is lowkey broken β€” it can't display non-ASCII characters, or it can't let you type them from the keyboard 😭. filterm fixes that situation. it also makes writing all kinds of terminal filters way easier, which is the real main character energy here πŸ‘‘

INPUT and OUTPUT are names of konwert's filters β€” they get passed as the first argument to the konwert(1) program. so:

  • filterm - OUTPUT β†’ filters only output
  • filterm INPUT - β†’ filters only input

and if COMMAND is -, it executes the shell as a login shell 🐚

ngl, this is different from konwert INPUT | COMMAND | konwert OUTPUT, and the difference matters: with filterm the command is executed on a pseudo-terminal, so full-screen programs actually work correctly πŸ”₯

⚠️ warning bestie: the filters have to output the characters as soon as they receive all necessary input, without buffering. no holding it in, no waiting, immediate.

so what's safe and what's not:

  • trs(1) scripts β†’ βœ… totally OK
  • sed(1), awk(1), or tr(1) scripts β†’ ❌ not OK, sorry
  • in C you may use read(), getchar(), fread(), and write(), but putchar() and fwrite() only together with fflush(stdout)
  • in C++: cin.get(), cout.put(), and cout <<
  • in perl: sysread, getc, read, and syswrite, but print only with $| = 1

also the filters get told who they are 🫢 β€” the input filter will have the environment variable FILTERM=in set, and the output one gets FILTERM=out. this way some filters can slightly alter their behaviour when they're working for filterm. iykyk

πŸŽ€ OPTIONS πŸŽ€

  • --help β€” display help and exit
  • --version β€” output version information and exit

πŸ’– FILTERS FOR FILTERM πŸ’–

go look at konwert(1) for the full rundown. additionally, the following konwert filters are designed only for filterm πŸ‘‡

πŸ’« tyldy (input)

Polish ~a~c~e~l~n~o~s~x~z

πŸ’« lewyap (input)

Polish `a`c`e`l`n`o`s`x`z

πŸ’« boldpl (output)

ASCII with Polish letters shown as bold.

πŸ’« pinectrlchars (output)

replaces the characters 128..159 shown by the Pine (or another program) as ^Γ€..^ß back to the real 128..159 πŸ™ˆ

πŸ’« 512bold (output)

changes the mapping of colors in 512-character mode, which restricts the number of colors to eight. the palette is dynamically changed to contain the eight most recently used colors. when more colors are used at once, some of them display incorrectly πŸ’€

πŸ’« 512bold1 (output)

changes the mapping of colors in 512-character mode. instead of ignoring the intensity, the following colors are available: black, red, green, white, blue, light magenta, light cyan, light gray; others are substituted with approximations. this gives a better effect, allowing to show the intensity, with the side-effect of belying the hue of some colors 😬

πŸ’« kbdmacros (input)

keyboard macros 🎹✨ a sequence of keys can be recorded with Esc Ctrl-A SEQUENCE Esc Ctrl-E SHORTCUT β€” after which, if you press the SHORTCUT, the SEQUENCE will be generated instead. later such assignment can be deleted with Esc Ctrl-A Esc Ctrl-E SHORTCUT Esc Ctrl-E. instead of Esc Ctrl- you often may press Ctrl-Alt-.

the defined shortcuts, together with the above redefinable key combinations used to define them, are stored in the ~/.kbdmacros file πŸ“

note: when you redefine a sequence, all its prefixes will not be passed through immediately, but wait until it can be unambiguously told which sequence was actually input. this includes escape sequences representing some extended keys.

🌈 SEE ALSO 🌈


πŸ’€ BUGS πŸ’€

512bold filter is not perfect. some escape sequences may be emulated incorrectly. additionally, colors changed in multiple steps or not used unnecessarily allocate some of the eight colors 😭 not great, not terrible, we move.


filterm filters terminal input and/or output. it forms part of the konwert package.

Copyright (c) 1998 Marcin 'Qrczak' Kowalczyk

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


🧚 AUTHOR 🧚

the one and only Marcin Kowalczyk, serving us an ASCII art rΓ©sumΓ©, we stan an icon:

 __("<   Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.home.ml.org/
 \__/       GCS/M d- s+:-- a21 C+++>+++$ UL++>++++$ P+++ L++>++++$ E->++
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-

okay that's the whole page, bestie 🫢 this was Konwert, dated 30 Jul 1998, FILTERM(1) β€” go filter something, slay πŸ’…βœ¨

πŸ“¦ where this page comes from