From b56629b6fdd8f846e50c0ae66a2b364401e6986e Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 1 Jun 2018 14:15:22 -0700 Subject: [PATCH] Set terminal type in the config file. Adds a "term" option that takes a terminal type (ie: vt100, xterm, xterm-256color, etc.) Example: ```yaml wtf: term: "vt100" ``` --- _site/content/posts/configuration/attributes.md | 9 +++++++++ docs/index.xml | 2 +- docs/posts/configuration/attributes/index.html | 11 ++++++++++- docs/posts/index.xml | 2 +- wtf.go | 2 ++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/_site/content/posts/configuration/attributes.md b/_site/content/posts/configuration/attributes.md index d709a8fb..93e7c3bb 100644 --- a/_site/content/posts/configuration/attributes.md +++ b/_site/content/posts/configuration/attributes.md @@ -25,6 +25,7 @@ wtf: rows: [10, 10, 10, 10, 10, 3, 4] # The app redraws itself once a second refreshInterval: 1 + term: "xterm-256color" ``` ### Attributes @@ -69,3 +70,11 @@ How often, in seconds, the UI refreshes itself.
**Note:** This implementation is probably wrong and buggy and likely to change.
Values: A positive integer, `0..n`. + +`term`
+This value is _optional_. Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal's +default setting.
+**Note:** If an invalid value is provided for this setting, the app will + crash with a `"terminal entry not found"` error.
+Values: Any valid terminal type (ie: vt100, xterm, xterm-256color, ansi, +etc.). diff --git a/docs/index.xml b/docs/index.xml index 22a96bce..f5186f07 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -82,7 +82,7 @@ cmd The terminal command to be run, withouth the arguments. Ie: ping, whoami, cu https://wtfutil.com/posts/configuration/attributes/ The following top-level attributes are configurable in config.yml. See this example config file for more details. -wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondrefreshInterval:1 Attributes colors. +wtf:colors:background:"red"border:Focusable:"darkslateblue"focused:"orange"normal:"gray"grid:# How _wide_ the columns are, in terminal characters. In this case we have# six columns, each of which are 35 characters widecolumns:[35,35,35,35,35,35]# How _high_ the rows are, in terminal lines. In this case we have five rows# that support ten line of text, one of three lines, and one of fourrows:[10,10,10,10,10,3,4]# The app redraws itself once a secondrefreshInterval:1term:"xterm-256color" Attributes colors. diff --git a/docs/posts/configuration/attributes/index.html b/docs/posts/configuration/attributes/index.html index 5bdd1beb..f8ae04f0 100644 --- a/docs/posts/configuration/attributes/index.html +++ b/docs/posts/configuration/attributes/index.html @@ -127,7 +127,8 @@ See this # that support ten line of text, one of three lines, and one of four rows: [10, 10, 10, 10, 10, 3, 4] # The app redraws itself once a second - refreshInterval: 1 + refreshInterval: 1 + term: "xterm-256color"

Attributes

colors.background
@@ -171,6 +172,14 @@ How often, in seconds, the UI refreshes itself.
change.
Values: A positive integer, 0..n.

+

term
+This value is optional. Sets a custom value for the terminal type this app runs in. Leave this entry out of the config if you simply want to use your terminal’s +default setting.
+Note: If an invalid value is provided for this setting, the app will + crash with a "terminal entry not found" error.
+Values: Any valid terminal type (ie: vt100, xterm, xterm-256color, ansi, +etc.).

+