Skip to content

Commit eccf622

Browse files
committed
config-schema: expand options for ui.editor, ui.diff.tool, and ui.pager
In addition to a single string, the `ui.editor` and `ui.diff.tool` options also allow arrays of strings. `ui.pager` allows arrays of strings as well as a nested table describing both the command and the environment. Update config-schema.json to allow all of these types of values. Fixes #5617
1 parent c187142 commit eccf622

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3535
expand `~/` to `$HOME/`.
3636
[#5626](https://github.com/jj-vcs/jj/pull/5626)
3737

38+
* `config-schema.json` now allows arrays of strings for the settings `ui.editor`
39+
and `ui.diff.tool`.
40+
41+
* `config-schema.json` now allows an array of strings or nested table for the
42+
`ui.pager` setting.
43+
3844
## [0.26.0] - 2025-02-05
3945

4046
### Release highlights

cli/src/config-schema.json

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@
4545
"git"
4646
],
4747
"default": "diff"
48+
},
49+
"command-env": {
50+
"type": "object",
51+
"properties": {
52+
"command": {
53+
"type": ["array", "string"],
54+
"items": {
55+
"type": "string"
56+
}
57+
},
58+
"env": {
59+
"type": "object"
60+
}
61+
}
4862
}
4963
},
5064
"properties": {
@@ -98,7 +112,20 @@
98112
"default": "auto"
99113
},
100114
"pager": {
101-
"type": "string",
115+
"oneOf": [
116+
{
117+
"type": "string"
118+
},
119+
{
120+
"type": "array",
121+
"items": {
122+
"type": "string"
123+
}
124+
},
125+
{
126+
"$ref": "#/properties/ui/definitions/command-env"
127+
}
128+
],
102129
"description": "Pager to use for displaying command output",
103130
"default": "less -FRX"
104131
},
@@ -140,7 +167,10 @@
140167
"default": "color-words"
141168
},
142169
"tool": {
143-
"type": "string",
170+
"type": ["array", "string"],
171+
"items": {
172+
"type": "string"
173+
},
144174
"description": "External tool for generating diffs"
145175
}
146176
}
@@ -177,7 +207,10 @@
177207
"default": true
178208
},
179209
"editor": {
180-
"type": "string",
210+
"type": ["array", "string"],
211+
"items": {
212+
"type": "string"
213+
},
181214
"description": "Editor to use for commands that involve editing text"
182215
},
183216
"diff-editor": {

0 commit comments

Comments
 (0)