Text color improvements.

This commit is contained in:
wb2osz 2019-07-06 20:34:51 -04:00
parent e962246fd2
commit ca7db91da2
2 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,10 @@
### New Features: ###
- "-t" option now accepts more values to accommodate inconsistent handling of text color control codes by different terminal emulators. The default, 1, should work with most modern terminal types. If the colors are not right, try "-t 9" to see the result of the different choices and pick the best one. If none of them look right, file a bug report and specify: operating system version (e.g. Raspbian Buster), terminal emulator type and version (e.g. LXTerminal 0.3.2). Include a screen capture.
- "-g" option to force G3RUH mode for lower speeds where a different modem type may be the default.
- 2400 bps compatibility with MFJ-2400. See ***2400-4800-PSK-for-APRS-Packet-Radio.pdf*** for details

View File

@ -248,10 +248,14 @@ int main (int argc, char *argv[])
/*
* Pre-scan the command line options for the text color option.
* We need to set this before any text output.
* Default will be no colors if stdout is not a terminal (i.e. piped into
* something else such as "tee") but command line can override this.
*/
t_opt = 1; /* 1 = normal, 0 = no text colors. */
t_opt = isatty(fileno(stdout));
/* 1 = normal, 0 = no text colors. */
/* 2, 3, ... alternate escape sequences for different terminals. */
for (j=1; j<argc-1; j++) {
if (strcmp(argv[j], "-t") == 0) {
t_opt = atoi (argv[j+1]);
@ -1352,7 +1356,7 @@ static void usage (char **argv)
dw_printf (" -q Quiet (suppress output) options:\n");
dw_printf (" h h = Heard line with the audio level.\n");
dw_printf (" d d = Decoding of APRS packets.\n");
dw_printf (" -t n Text colors. 0=disabled. 1=default. 2 is good for PuTTY.\n");
dw_printf (" -t n Text colors. 0=disabled. 1=default. 2,3,4,... alternatives.\n");
dw_printf (" Use 9 to test compatibility with your terminal.\n");
dw_printf (" -a n Audio statistics interval in seconds. 0 to disable.\n");
#if __WIN32__