Refresh plugin for Take Command

Version 1.0.1     2023-10-13

Charles Dye

Purpose:

This plugin is intended to work around sporadic issues with Take Command’s tab window not being updated. It adds a new hotkey, F5, to refresh the current tab window. It also provides one new command, REFRESHOPTS, to display or change plugin settings; and replaces one internal command, CLS.

Installation:

To use this plugin, copy Refresh.dll to some known location on your hard drive. (If you are still using the 32-bit version of Take Command, take Refresh-x86.dll instead of PlugIn.dll.) Load the .DLL file with a PLUGIN /L command, for example:

plugin /l c:\bin\tcmd\test\refresh.dll

If you copy these files to a subdirectory named PlugIns within your Take Command program directory, the plugin will be loaded automatically when TCC starts.

Plugin Features:

New command: REFRESHOPTS

Modified command: CLS

New hotkey: F5

Syntax Note:

The syntax definitions in the following text use these conventions for clarity:

BOLD CODEindicates text which must be typed exactly as shown.
CODEindicates optional text, which may be typed as shown or omitted.
Bold italicnames a required argument; a value must be supplied.
Regular italicnames an optional argument.
ellipsis…after an argument means that more than one may be given.

Plugin Commands:

REFRESHOPTS — Display and change plugin settings.

Syntax:
REFRESHOPTS /B:n /C:color /D /H:n /K:key /L /R /S /T:n /W:n

/B:nenable the error beep; 0 disables, 1 enables1
/C:colorspecify the hatch color (as a W3C color name)CadetBlue
/Drestore the original default plugin settings 
/H:nhook the CLS command; 0 disables, 1 enables1
/K:keyset the hotkeyF5
/Llist all supported hotkeys to stdout 
/Rrestore saved settings from the registry 
/Ssave settings to the registry as the new defaults 
/T:nset the hatch time (for the F5 key); 0 disables it100
/W:nset the hatch time (for the CLS command); 0 disables it0

/K:key lets you change the hotkey used to refresh the tab window. The default is F5. To see a list of all supported hotkeys, type REFRESHOPTS /L.

/C:color sets the color for the hatch pattern that is briefly displayed when you press F5. The color is a W3C color name, not the more familiar (and smaller) set of TCC colors. Alternatively, you can specify the color in RGB format as #RRGGBB, where RR, GG, and BB are two-digit hexadecimal values. The default is CadetBlue.

/T:n sets the duration of the hatch pattern shown when you press F5. The value is in milliseconds; the range is 0 to 1000. A value of 0 disables the hatch. The default is 100.

/W:n works the same as /T, but for the CLS command. The default is 0; CLS does not show the hatch by default.

/H:n controls whether this plugin intercepts the CLS command. /H:1 causes the plugin to substitute its own CLS for TCC’s. /H:0 disables the plugin command, re-exposing TCC’s internal CLS.

/B:n enables or disables the error beep if you press the hotkey and the plugin cannot identify the tab window. (This will happen, for example, if you press F5 while TCC is running in a standalone console window.) 0 disables the error beep, and 1 enables it.

/S saves the current settings to the registry as the new defaults. These settings will be loaded automatically when you load this plugin in the future.

/D restores the original default plugin settings, documented in the third column of the table above.

/R reloads any settings previously saved to the registry with /S. Note that /D and /R are mutually exclusive.

/L dumps a list of supported hotkeys to standard output. Don’t combine /L with any other options; it’s just a simpleminded info dump.


refreshopts /k:alt-R /t:75 /c:DarkSeaGreen /s



CLS — Clear the tab window, and optionally specify new screen colors.

Syntax:
CLS /C /S fg ON bg

/Cclear the entire buffer, not just the visible part
/Sscroll to preserve as much text as possible
fg ON bgspecify new screen colors

This command is intended to be compatible with TCC’s internal CLS command, but it also forces a redraw of the Take Command tab window.

To change colors, you must give both the foreground and background colors; the word ON is required. Color specifications use the usual TCC names for the CGA palette. Only the first three letters of each word are required; for example, “bright magenta” may be written as “bri mag”.

  Black   Bright Black
  Blue   Bright Blue
  Green   Bright Green
  Cyan   Bright Cyan
  Red   Bright Red
  Magenta   Bright Magenta
  Yellow   Bright Yellow
  White   Bright White

If you change the screen colors, you should use /C so your new colors will fill the entire buffer, not just the visible part.


cls /c bri whi on blu



New Hotkey:

F5 — Refreshes the Take Command tab window.

When you press F5, the plugin will briefly display a ‘hatch’ pattern in the tab window, then force a redraw of the tab’s contents. The hatch pattern is for cosmetic and troubleshooting purposes only. It is not required; you can disable it with REFRESHOPTS /T:0. You can also use REFRESHOPTS to change the hatch color and duration, or to set a different hotkey.

If the plugin cannot find a Take Command tab window, it will beep. You can disable this error beep with REFRESHOPTS /B:0.

This feature does not rely on backdoor communication between TCC and Take Command; it should work in TCC/LE in a tab window.



W3C Color Names:

REFRESHOPTS uses W3C color names, not the much shorter list of CGA colors familiar from most TCC commands and functions. Here is a list of the W3C color names supported by this plugin, with their equivalent values. Names containing “gray” may be spelled using “grey” if you prefer.

  AliceBlue 0xF0F8FF   LightSalmon 0xFFA07A
  AntiqueWhite 0xFAEBD7   LightSeaGreen 0x20B2AA
  Aqua 0x00FFFF   LightSkyBlue 0x87CEFA
  Aquamarine 0x7FFFD4   LightSlateGray 0x778899
  Azure 0xF0FFFF   LightSteelBlue 0xB0C4DE
  Beige 0xF5F5DC   LightYellow 0xFFFFE0
  Bisque 0xFFE4C4   Lime 0x00FF00
  Black 0x000000   LimeGreen 0x32CD32
  BlanchedAlmond 0xFFEBCD   Linen 0xFAF0E6
  Blue 0x0000FF   Magenta 0xFF00FF
  BlueViolet 0x8A2BE2   Maroon 0x800000
  Brown 0xA52A2A   MediumAquaMarine 0x66CDAA
  BurlyWood 0xDEB887   MediumBlue 0x0000CD
  CadetBlue 0x5F9EA0   MediumOrchid 0xBA55D3
  Chartreuse 0x7FFF00   MediumPurple 0x9370DB
  Chocolate 0xD2691E   MediumSeaGreen 0x3CB371
  Coral 0xFF7F50   MediumSlateBlue 0x7B68EE
  CornflowerBlue 0x6495ED   MediumSpringGreen 0x00FA9A
  Cornsilk 0xFFF8DC   MediumTurquoise 0x48D1CC
  Crimson 0xDC143C   MediumVioletRed 0xC71585
  Cyan 0x00FFFF   MidnightBlue 0x191970
  DarkBlue 0x00008B   MintCream 0xF5FFFA
  DarkCyan 0x008B8B   MistyRose 0xFFE4E1
  DarkGoldenrod 0xB8860B   Moccasin 0xFFE4B5
  DarkGray 0xA9A9A9   NavajoWhite 0xFFDEAD
  DarkGreen 0x006400   Navy 0x000080
  DarkKhaki 0xBDB76B   OldLace 0xFDF5E6
  DarkMagenta 0x8B008B   Olive 0x808000
  DarkOliveGreen 0x556B2F   OliveDrab 0x6B8E23
  DarkOrange 0xFF8C00   Orange 0xFFA500
  DarkOrchid 0x9932CC   OrangeRed 0xFF4500
  DarkRed 0x8B0000   Orchid 0xDA70D6
  DarkSalmon 0xE9967A   PaleGoldenrod 0xEEE8AA
  DarkSeaGreen 0x8FBC8F   PaleGreen 0x98FB98
  DarkSlateBlue 0x483D8B   PaleTurquoise 0xAFEEEE
  DarkSlateGray 0x2F4F4F   PaleVioletRed 0xDB7093
  DarkTurquoise 0x00CED1   PapayaWhip 0xFFEFD5
  DarkViolet 0x9400D3   PeachPuff 0xFFDAB9
  DeepPink 0xFF1493   Peru 0xCD853F
  DeepSkyBlue 0x00BFFF   Pink 0xFFC0CB
  DimGray 0x696969   Plum 0xDDA0DD
  DodgerBlue 0x1E90FF   PowderBlue 0xB0E0E6
  FireBrick 0xB22222   Purple 0x800080
  FloralWhite 0xFFFAF0   Red 0xFF0000
  ForestGreen 0x228B22   RosyBrown 0xBC8F8F
  Fuchsia 0xFF00FF   RoyalBlue 0x4169E1
  Gainsboro 0xDCDCDC   SaddleBrown 0x8B4513
  GhostWhite 0xF8F8FF   Salmon 0xFA8072
  Gold 0xFFD700   SandyBrown 0xF4A460
  Goldenrod 0xDAA520   SeaGreen 0x2E8B57
  Gray 0x808080   Seashell 0xFFF5EE
  Green 0x008000   Sienna 0xA0522D
  GreenYellow 0xADFF2F   Silver 0xC0C0C0
  Honeydew 0xF0FFF0   SkyBlue 0x87CEEB
  Hotpink 0xFF69B4   SlateBlue 0x6A5ACD
  IndianRed 0xCD5C5C   SlateGray 0x708090
  Indigo 0x4B0082   Snow 0xFFFAFA
  Ivory 0xFFFFF0   SpringGreen 0x00FF7F
  Khaki 0xF0E68C   SteelBlue 0x4682B4
  Lavender 0xE6E6FA   Tan 0xD2B48C
  LavenderBlush 0xFFF0F5   Teal 0x008080
  LawnGreen 0x7CFC00   Thistle 0xD8BFD8
  LemonChiffon 0xFFFACD   Tomato 0xFF6347
  LightBlue 0xADD8E6   Turquoise 0x40E0D0
  LightCoral 0xF08080   Violet 0xEE82EE
  LightCyan 0xE0FFFF   Wheat 0xF5DEB3
  LightGoldenrodYellow 0xFAFAD2   White 0xFFFFFF
  LightGray 0xD3D3D3   WhiteSmoke 0xF5F5F5
  LightGreen 0x90EE90   Yellow 0xFFFF00
  LightPink 0xFFB6C1   YellowGreen 0x9ACD32

Startup Message:

This plugin displays an informational line when it initializes. The message will be suppressed in transient or pipe shells. You can disable it for all shells by defining an environment variable named NOLOADMSG, for example:

set /e /u noloadmsg=1

Changes:


Version:Date:Changes:
1.0.1.12023-10-13Updated the plugin’s web address.
1.0.12023-07-28Updated to the current version of HotKeys.cpp. Moved the arg parser out to ParseArgs.cpp.
1.0.02021-07-08First release.

Status and Licensing:

This plugin is © Copyright 2023, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. If you find a problem, you can report it in the JP Software support forum.

Download:

You can download the current version of the plugin from http://charlesdye.net/dl/refresh.zip.