tui-config-schema.json 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "title": "Terminal.Gui Configuration",
  4. "description": "Configuration settings for Terminal.Gui applications. This schema defines settings for the application behavior, appearance, themes, key bindings, and component-specific options.",
  5. "type": "object",
  6. "properties": {
  7. "$schema": {
  8. "type": "string",
  9. "format": "uri",
  10. "description": "The URI of the schema that this configuration file adheres to. Optional but recommended for validation."
  11. },
  12. "ConfigurationManager.ThrowOnJsonErrors": {
  13. "type": "boolean",
  14. "default": false,
  15. "description": "If true, JSON parsing errors encountered during configuration loading will throw exceptions. If false, errors are typically logged, and default values may be used."
  16. },
  17. "Key.Separator": {
  18. "type": "string",
  19. "default": "+",
  20. "description": "The character used to separate modifiers and keys in key string representations (e.g., 'Ctrl+Q')."
  21. },
  22. "Application.ArrangeKey": {
  23. "type": "string",
  24. "default": "Ctrl+F5",
  25. "description": "The key combination used to trigger an arrange or layout command, often for tiling or re-organizing windows."
  26. },
  27. "Application.Force16Colors": {
  28. "type": "boolean",
  29. "default": false,
  30. "description": "If true, forces the console driver to output only the basic 16 ANSI colors, even if the terminal supports more (e.g., 256 colors or TrueColor)."
  31. },
  32. "Application.ForceDriver": {
  33. "type": [
  34. "string",
  35. "null"
  36. ],
  37. "enum": [
  38. "",
  39. "fake",
  40. "ansi",
  41. "curses",
  42. "net",
  43. "windows",
  44. null
  45. ],
  46. "default": "",
  47. "description": "Forces the use of a specific console driver. If empty or null, Terminal.Gui will attempt to auto-detect the best driver. Options: 'fake', 'ansi', 'curses', 'net', 'windows'."
  48. },
  49. "Application.IsMouseDisabled": {
  50. "type": "boolean",
  51. "default": false,
  52. "description": "Disables or enables mouse support for the application. If true, mouse events will be ignored."
  53. },
  54. "Application.NextTabGroupKey": {
  55. "type": "string",
  56. "default": "F6",
  57. "description": "The key combination to navigate to the next logical group of controls or container (e.g., 'F6', 'Ctrl+PageDown')."
  58. },
  59. "Application.NextTabKey": {
  60. "type": "string",
  61. "default": "Tab",
  62. "description": "The key combination to navigate to the next focusable view or tab stop (e.g., 'Tab')."
  63. },
  64. "Application.PrevTabGroupKey": {
  65. "type": "string",
  66. "default": "Shift+F6",
  67. "description": "The key combination to navigate to the previous logical group of controls or container (e.g., 'Shift+F6', 'Ctrl+PageUp')."
  68. },
  69. "Application.PrevTabKey": {
  70. "type": "string",
  71. "default": "Shift+Tab",
  72. "description": "The key combination to navigate to the previous focusable view or tab stop (e.g., 'Shift+Tab')."
  73. },
  74. "Application.QuitKey": {
  75. "type": "string",
  76. "default": "Esc",
  77. "description": "The primary key combination used to request the application to quit (e.g., 'Esc', 'Ctrl+Q')."
  78. },
  79. "Application.AlternateForwardKey": {
  80. "type": "string",
  81. "description": "An alternative key combination for forward navigation or cycling through elements, often used in specific contexts (e.g., 'Ctrl+CursorRight')."
  82. },
  83. "Application.AlternateBackwardKey": {
  84. "type": "string",
  85. "description": "An alternative key combination for backward navigation or cycling through elements (e.g., 'Ctrl+CursorLeft')."
  86. },
  87. "Application.ShortCutKey": {
  88. "type": "string",
  89. "description": "The key used to activate shortcuts or hotkeys within views (e.g., 'AltMask', 'F9'). Typically used for menu shortcuts."
  90. },
  91. "PopoverMenu.DefaultKey": {
  92. "type": "string",
  93. "default": "Shift+F10",
  94. "description": "Default key to open the context menu (PopoverMenu)."
  95. },
  96. "FileDialog.MaxSearchResults": {
  97. "type": "integer",
  98. "default": 10000,
  99. "description": "Maximum number of search results to display in the FileDialog."
  100. },
  101. "FileDialogStyle.DefaultUseColors": {
  102. "type": "boolean",
  103. "default": false,
  104. "description": "Whether the FileDialog should use colors by default to differentiate file/directory types."
  105. },
  106. "FileDialogStyle.DefaultUseUnicodeCharacters": {
  107. "type": "boolean",
  108. "default": false,
  109. "description": "Whether the FileDialog should use Unicode characters for icons by default."
  110. },
  111. "Colors16": {
  112. "type": "object",
  113. "description": "Defines the 3-byte/6-character hexadecimal string values for the 16 legacy ANSI color names (ColorName16). These definitions can be overridden by the user to customize the base 16 color palette.",
  114. "properties": {
  115. "Black": {
  116. "type": "string",
  117. "pattern": "^#[0-9a-fA-F]{6}$",
  118. "description": "Hex string for ColorName16.Black (typically #000000)."
  119. },
  120. "Blue": {
  121. "type": "string",
  122. "pattern": "^#[0-9a-fA-F]{6}$",
  123. "description": "Hex string for ColorName16.Blue (typically #000080, a dark blue like Navy)."
  124. },
  125. "Green": {
  126. "type": "string",
  127. "pattern": "^#[0-9a-fA-F]{6}$",
  128. "description": "Hex string for ColorName16.Green (typically #008000, a dark green)."
  129. },
  130. "Cyan": {
  131. "type": "string",
  132. "pattern": "^#[0-9a-fA-F]{6}$",
  133. "description": "Hex string for ColorName16.Cyan (typically #008080, a dark cyan like Teal)."
  134. },
  135. "Red": {
  136. "type": "string",
  137. "pattern": "^#[0-9a-fA-F]{6}$",
  138. "description": "Hex string for ColorName16.Red (typically #800000, a dark red like Maroon)."
  139. },
  140. "Magenta": {
  141. "type": "string",
  142. "pattern": "^#[0-9a-fA-F]{6}$",
  143. "description": "Hex string for ColorName16.Magenta (typically #800080, a dark magenta like Purple)."
  144. },
  145. "Yellow": {
  146. "type": "string",
  147. "pattern": "^#[0-9a-fA-F]{6}$",
  148. "description": "Hex string for ColorName16.Yellow (typically #808000, a dark yellow like Olive)."
  149. },
  150. "Gray": {
  151. "type": "string",
  152. "pattern": "^#[0-9a-fA-F]{6}$",
  153. "description": "Hex string for ColorName16.Gray (typically #C0C0C0, a light gray like Silver)."
  154. },
  155. "DarkGray": {
  156. "type": "string",
  157. "pattern": "^#[0-9a-fA-F]{6}$",
  158. "description": "Hex string for ColorName16.DarkGray (typically #808080, a medium gray)."
  159. },
  160. "BrightBlue": {
  161. "type": "string",
  162. "pattern": "^#[0-9a-fA-F]{6}$",
  163. "description": "Hex string for ColorName16.BrightBlue (typically #0000FF)."
  164. },
  165. "BrightGreen": {
  166. "type": "string",
  167. "pattern": "^#[0-9a-fA-F]{6}$",
  168. "description": "Hex string for ColorName16.BrightGreen (typically #00FF00, like Lime)."
  169. },
  170. "BrightCyan": {
  171. "type": "string",
  172. "pattern": "^#[0-9a-fA-F]{6}$",
  173. "description": "Hex string for ColorName16.BrightCyan (typically #00FFFF, like Aqua)."
  174. },
  175. "BrightRed": {
  176. "type": "string",
  177. "pattern": "^#[0-9a-fA-F]{6}$",
  178. "description": "Hex string for ColorName16.BrightRed (typically #FF0000)."
  179. },
  180. "BrightMagenta": {
  181. "type": "string",
  182. "pattern": "^#[0-9a-fA-F]{6}$",
  183. "description": "Hex string for ColorName16.BrightMagenta (typically #FF00FF, like Fuchsia)."
  184. },
  185. "BrightYellow": {
  186. "type": "string",
  187. "pattern": "^#[0-9a-fA-F]{6}$",
  188. "description": "Hex string for ColorName16.BrightYellow (typically #FFFF00)."
  189. },
  190. "White": {
  191. "type": "string",
  192. "pattern": "^#[0-9a-fA-F]{6}$",
  193. "description": "Hex string for ColorName16.White (typically #FFFFFF)."
  194. }
  195. },
  196. "additionalProperties": false
  197. },
  198. "Theme": {
  199. "type": "string",
  200. "default": "Default",
  201. "description": "The name of the theme to be applied at application startup. This name must match one of the theme names defined in the 'Themes' array."
  202. },
  203. "Themes": {
  204. "type": "array",
  205. "description": "A list of theme definitions. Each theme provides a distinct look and feel for the application.",
  206. "items": {
  207. "type": "object",
  208. "description": "A single theme definition. The object should have exactly one property, where the key is the unique name of the theme (e.g., 'Default', 'Dark'), and the value contains the theme's settings.",
  209. "maxProperties": 1,
  210. "minProperties": 1,
  211. "patternProperties": {
  212. "^[\\w\\s&\\(\\)-]+$": {
  213. "$ref": "#/definitions/themeSettings"
  214. }
  215. },
  216. "additionalProperties": false
  217. }
  218. }
  219. },
  220. "additionalProperties": true,
  221. "definitions": {
  222. "Color": {
  223. "description": "One be either one of the W3C standard color names (parsed case-insensitively), a ColorName16 (e.g. 'BrightBlue', parsed case-insensitively), an rgb(r,g,b) tuple, or a hex color string in the format #RRGGBB.",
  224. "$schema": "http://json-schema.org/draft-07/schema#",
  225. "type": "string",
  226. "oneOf": [
  227. {
  228. "type": "string",
  229. "enum": [
  230. "AliceBlue",
  231. "AmberPhosphor",
  232. "AntiqueWhite",
  233. "Aqua",
  234. "Aquamarine",
  235. "Azure",
  236. "Beige",
  237. "Bisque",
  238. "Black",
  239. "BlanchedAlmond",
  240. "Blue",
  241. "BlueViolet",
  242. "BrightBlue",
  243. "BrightCyan",
  244. "BrightGreen",
  245. "BrightMagenta",
  246. "BrightRed",
  247. "BrightYellow",
  248. "Brown",
  249. "BurlyWood",
  250. "CadetBlue",
  251. "Charcoal",
  252. "CornflowerBlue",
  253. "Cornsilk",
  254. "Crimson",
  255. "Cyan",
  256. "DarkBlue",
  257. "DarkCyan",
  258. "DarkGoldenrod",
  259. "DarkGray",
  260. "DarkGreen",
  261. "DarkGrey",
  262. "DarkKhaki",
  263. "DarkMagenta",
  264. "DarkOliveGreen",
  265. "DarkOrange",
  266. "DarkOrchid",
  267. "DarkRed",
  268. "DarkSalmon",
  269. "DarkSeaGreen",
  270. "DarkSlateBlue",
  271. "DarkSlateGray",
  272. "DarkSlateGrey",
  273. "DarkTurquoise",
  274. "DarkViolet",
  275. "DeepPink",
  276. "DeepSkyBlue",
  277. "DimGray",
  278. "DimGrey",
  279. "DodgerBlue",
  280. "Ebony",
  281. "FireBrick",
  282. "FloralWhite",
  283. "FluorescentOrange",
  284. "ForestGreen",
  285. "Fuchsia",
  286. "Gainsboro",
  287. "GhostWhite",
  288. "Gold",
  289. "Goldenrod",
  290. "Gray",
  291. "Green",
  292. "GreenPhosphor",
  293. "GreenYellow",
  294. "Grey",
  295. "GuppieGreen",
  296. "HoneyDew",
  297. "HotPink",
  298. "IndianRed",
  299. "Indigo",
  300. "Ivory",
  301. "Jet",
  302. "Khaki",
  303. "Lavender",
  304. "LavenderBlush",
  305. "LawnGreen",
  306. "LemonChiffon",
  307. "LightBlue",
  308. "LightCoral",
  309. "LightCyan",
  310. "LightGoldenrodYellow",
  311. "LightGray",
  312. "LightGreen",
  313. "LightGrey",
  314. "LightPink",
  315. "LightSalmon",
  316. "LightSeaGreen",
  317. "LightSkyBlue",
  318. "LightSlateGray",
  319. "LightSlateGrey",
  320. "LightSteelBlue",
  321. "LightYellow",
  322. "Lime",
  323. "LimeGreen",
  324. "Linen",
  325. "Magenta",
  326. "Maroon",
  327. "MediumAquaMarine",
  328. "MediumBlue",
  329. "MediumOrchid",
  330. "MediumPurple",
  331. "MediumSeaGreen",
  332. "MediumSlateBlue",
  333. "MediumSpringGreen",
  334. "MediumTurquoise",
  335. "MediumVioletRed",
  336. "MidnightBlue",
  337. "MintCream",
  338. "MistyRose",
  339. "Moccasin",
  340. "NavajoWhite",
  341. "Navy",
  342. "OldLace",
  343. "Olive",
  344. "OliveDrab",
  345. "Onyx",
  346. "Orange",
  347. "OrangeRed",
  348. "Orchid",
  349. "OuterSpace",
  350. "PaleGoldenRod",
  351. "PaleGreen",
  352. "PaleTurquoise",
  353. "PaleVioletRed",
  354. "PapayaWhip",
  355. "PeachPuff",
  356. "Peru",
  357. "Pink",
  358. "Plum",
  359. "PowderBlue",
  360. "Purple",
  361. "RaisinBlack",
  362. "RebeccaPurple",
  363. "Red",
  364. "RosyBrown",
  365. "RoyalBlue",
  366. "SaddleBrown",
  367. "Salmon",
  368. "SandyBrown",
  369. "SeaGreen",
  370. "SeaShell",
  371. "Sienna",
  372. "Silver",
  373. "SkyBlue",
  374. "SlateBlue",
  375. "SlateGray",
  376. "SlateGrey",
  377. "Snow",
  378. "SpringGreen",
  379. "SteelBlue",
  380. "Tan",
  381. "Teal",
  382. "Thistle",
  383. "Tomato",
  384. "Turquoise",
  385. "Violet",
  386. "Wheat",
  387. "White",
  388. "WhiteSmoke",
  389. "Yellow",
  390. "YellowGreen"
  391. ]
  392. },
  393. {
  394. "type": "string",
  395. "pattern": "^rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)$"
  396. },
  397. {
  398. "type": "string",
  399. "pattern": "^#[0-9a-fA-F]{6}$"
  400. }
  401. ]
  402. },
  403. "attribute": {
  404. "type": "object",
  405. "description": "Defines the foreground color, background color, and style for a specific UI element state.",
  406. "properties": {
  407. "Foreground": {
  408. "$ref": "#/definitions/Color"
  409. },
  410. "Background": {
  411. "$ref": "#/definitions/Color"
  412. },
  413. "Style": {
  414. "type": "string",
  415. "default": "None",
  416. "description": "Text style. Parsed case-insensitively by the application. Can be a single style or a comma-separated list of the following valid flags: None, Bold, Italic, Underline, Faint, Blink, Reverse, Strikethrough (e.g., 'Bold,Italic').",
  417. "pattern": "^(None|Bold|Italic|Underline|Faint|Blink|Reverse|Strikethrough)(\\s*,\\s*(None|Bold|Italic|Underline|Faint|Blink|Reverse|Strikethrough))*$"
  418. }
  419. },
  420. "required": [
  421. "Foreground",
  422. "Background"
  423. ],
  424. "additionalProperties": false
  425. },
  426. "scheme": {
  427. "type": "object",
  428. "description": "A collection of attributes defining the appearance of UI elements in different states (normal, focused, etc.).",
  429. "properties": {
  430. "Normal": {
  431. "$ref": "#/definitions/attribute",
  432. "description": "Appearance in the normal, non-focused state."
  433. },
  434. "Focus": {
  435. "$ref": "#/definitions/attribute",
  436. "description": "Appearance when the element has input focus."
  437. },
  438. "HotNormal": {
  439. "$ref": "#/definitions/attribute",
  440. "description": "Appearance for a 'hot' element (e.g., mouse hover) that is not focused."
  441. },
  442. "HotFocus": {
  443. "$ref": "#/definitions/attribute",
  444. "description": "Appearance for a 'hot' element that also has input focus."
  445. },
  446. "Disabled": {
  447. "$ref": "#/definitions/attribute",
  448. "description": "Appearance when the element is disabled."
  449. },
  450. "Active": {
  451. "$ref": "#/definitions/attribute",
  452. "description": "Appearance when the element is active."
  453. },
  454. "HotActive": {
  455. "$ref": "#/definitions/attribute",
  456. "description": "Appearance for a 'hot' element that is also active."
  457. },
  458. "Highlight": {
  459. "$ref": "#/definitions/attribute",
  460. "description": "Appearance for a highlighted element."
  461. },
  462. "Editable": {
  463. "$ref": "#/definitions/attribute",
  464. "description": "Appearance for an editable element."
  465. },
  466. "ReadOnly": {
  467. "$ref": "#/definitions/attribute",
  468. "description": "Appearance for a read-only element."
  469. }
  470. },
  471. "required": [
  472. "Normal"
  473. ],
  474. "additionalProperties": false
  475. },
  476. "themeSettings": {
  477. "type": "object",
  478. "description": "Contains all settings for a specific theme, including default styles for various UI elements, glyphs, and color schemes.",
  479. "properties": {
  480. "BasedOn": {
  481. "type": "string",
  482. "description": "The name of another theme that this theme inherits settings from. Settings in the current theme will override those from the base theme."
  483. },
  484. "Dialog.DefaultButtonAlignment": {
  485. "type": "string",
  486. "enum": [
  487. "Start",
  488. "End",
  489. "Center",
  490. "Fill"
  491. ],
  492. "description": "Default horizontal alignment for buttons within Dialog views."
  493. },
  494. "Dialog.DefaultButtonAlignmentModes": {
  495. "type": "string",
  496. "enum": [
  497. "None",
  498. "AddSpaceBetweenItems",
  499. "AddSpaceAroundItems"
  500. ],
  501. "description": "Specifies how extra space is distributed between buttons in Dialog views when alignment is 'Start', 'End', or 'Center'."
  502. },
  503. "Dialog.DefaultBorderStyle": {
  504. "type": "string",
  505. "enum": [
  506. "None",
  507. "Single",
  508. "Double",
  509. "Heavy",
  510. "Rounded"
  511. ],
  512. "description": "Default border style for Dialog views."
  513. },
  514. "Dialog.DefaultShadow": {
  515. "type": "string",
  516. "enum": [
  517. "None",
  518. "Transparent",
  519. "Opaque"
  520. ],
  521. "description": "Default shadow style for Dialog views, rendered behind the dialog."
  522. },
  523. "FrameView.DefaultBorderStyle": {
  524. "type": "string",
  525. "enum": [
  526. "None",
  527. "Single",
  528. "Double",
  529. "Heavy",
  530. "Rounded"
  531. ],
  532. "description": "Default border style for FrameView controls."
  533. },
  534. "Window.DefaultBorderStyle": {
  535. "type": "string",
  536. "enum": [
  537. "None",
  538. "Single",
  539. "Double",
  540. "Heavy",
  541. "Rounded"
  542. ],
  543. "description": "Default border style for Window views."
  544. },
  545. "MessageBox.DefaultButtonAlignment": {
  546. "type": "string",
  547. "enum": [
  548. "Start",
  549. "End",
  550. "Center",
  551. "Fill"
  552. ],
  553. "description": "Default horizontal alignment for buttons within MessageBox views."
  554. },
  555. "MessageBox.DefaultBorderStyle": {
  556. "type": "string",
  557. "enum": [
  558. "None",
  559. "Single",
  560. "Double",
  561. "Heavy",
  562. "Rounded"
  563. ],
  564. "description": "Default border style for MessageBox views."
  565. },
  566. "Button.DefaultShadow": {
  567. "type": "string",
  568. "enum": [
  569. "None",
  570. "Transparent",
  571. "Opaque"
  572. ],
  573. "description": "Default shadow style for Button controls, often used for 3D effect."
  574. },
  575. "Menuv2.DefaultBorderStyle": {
  576. "type": "string",
  577. "enum": [
  578. "None",
  579. "Single",
  580. "Double",
  581. "Heavy",
  582. "Rounded"
  583. ],
  584. "description": "Default border style for the newer Menuv2 control and its sub-menus."
  585. },
  586. "MenuBarv2.DefaultBorderStyle": {
  587. "type": "string",
  588. "enum": [
  589. "None",
  590. "Single",
  591. "Double",
  592. "Heavy",
  593. "Rounded"
  594. ],
  595. "description": "Default border style for the MenuBarv2 control."
  596. },
  597. "StatusBar.DefaultSeparatorLineStyle": {
  598. "type": "string",
  599. "enum": [
  600. "None",
  601. "Single",
  602. "Double",
  603. "Heavy"
  604. ],
  605. "description": "Default style for separator lines in the StatusBar."
  606. },
  607. "Schemes": {
  608. "type": "array",
  609. "description": "A list of scheme definitions for this theme. Each item in the array is an object containing one or more named schemes (e.g., 'TopLevel', 'Base', 'Menu').",
  610. "items": {
  611. "type": "object",
  612. "description": "An object where each key is a scheme name (e.g., 'Base', 'Error') and its value is the scheme definition.",
  613. "patternProperties": {
  614. "^[A-Za-z][A-Za-z0-9_]*$": {
  615. "$ref": "#/definitions/scheme"
  616. }
  617. },
  618. "additionalProperties": false,
  619. "minProperties": 1
  620. }
  621. }
  622. },
  623. "patternProperties": {
  624. "^Glyphs\\.[A-Za-z0-9]+$": {
  625. "type": "string",
  626. "description": "A specific glyph character used by the theme for drawing UI elements like borders, arrows, indicators, etc. (e.g., 'Glyphs.LeftArrow', 'Glyphs.HLine'). The string value is the character to be used."
  627. }
  628. },
  629. "additionalProperties": true
  630. }
  631. }
  632. }