Add attributes to text-Tat plugin by Zeek

In CMD, we do not have any default option to enhance the text by adding attributes to it. Such as making the text bold, Italic, or having an Underline, etc. The TAT plugin adds attributes to simple text to make it more attractive. This plugin will help you in making batch programs that will be more interactive and different from other programs. The Tat plugin unlocks some ANSI Escape Sequences in an easy-to-use format for batch programs. The Tat plugin is created by Zeek Halkyr. You can download this plugin from our GitHub.

Usage

The usage of this plugin is very simple. You just have to call the plugin, and mention the attributes you want to add to your terminal. Everything you type after that will have the attributes that you mentioned above, until you reset via the plugin.

tat <attributes>

To reset the screen (wipe all attributes):

tat reset

Attributes and their behavior.

You can apply the attributes in any order while separating them by spaces. If you call the plugin, and do not add an attribute, it is automatically disabled. E.g, calling tat dim and then calling tat underline will disable dim. To avoid this, make sure to include all the formatting you want in each call, e.g tat underline dim.

The full list of attributes:

  • bold (or b) – Bold is not noticeable in cmd, but is noticeably stronger on Terminal. It is used to undo the dim attribute.
  • un͟d͟e͟r͟l͟i͟n͟e͟ (or ul) – adds an underline to text. This is the small version of the underline (1/2 big underline)*
  • blink (or bk) – The foreground text will flash between ‘bold’ (default) and ‘dim’ at a slow pace (fast blink not supported in Windows)
  • negative (or ng) – The text will be inverted (foreground color will be background, the background will be foreground)
  • dim (or d) – The text will be dimmed, use the bold attribute to undo this.
  • bigun͟d͟e͟r͟l͟i͟n͟e͟ (or bu) – adds a large underline (2x the size of underline) to the text*
  • strikethrough (or st) – adds a strikethrough to the text*
  • overline (or ol) – adds an overline to the text*
  • italic (or it) – Slants the text and makes it noticeably sharper*
  • normal (or n) – resets dim and negative attributes in one simple attribute.
  • foreground (or fg) – sets the foreground text color to the following argument. the next argument must be in the form of R, G, B (where R, G, B values between 0-255)
  • background (or bg) – sets the background text color to the following argument, same behavior as the foreground.

A note from the developer: These attributes will populate the entire row when the screen is resized horizontally. This is a bug within the windows console host and out of my control.

Demonstration

In the image below, I have demonstrated how to use the Tat plugin. Initially, I have applied bold and underline attributes to the text. Then I applied a negative attribute by which the initially applied attributes were reset.

Below I have shown the visual example of what each attribute do-

Demonstration of what the TAT plugin can do

Conclusion

As you can see, this plugin will help you add text attributes on the terminal which is usually not possible. This will help programmers to customize their batch programs and plugins to increase the user-friendliness of the program. For more plugins like this visit our site at Batch-man, you can also join our Discord and YouTube community. Thank you for reading this article. If you have any comments or suggestions, feel free to leave them below.

Leave a Reply