You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Custom_Command_Keybindings.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ customCommands:
14
14
- key: 'C'
15
15
context: 'global'
16
16
command: "git commit"
17
-
subprocess: true
17
+
output: terminal
18
18
- key: 'n'
19
19
context: 'localBranches'
20
20
prompts:
@@ -53,13 +53,11 @@ For a given custom command, here are the allowed fields:
53
53
| key | The key to trigger the command. Use a single letter or one of the values from [here](https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md). Custom commands without a key specified can be triggered by selecting them from the keybindings (`?`) menu | no |
54
54
| command | The command to run (using Go template syntax for placeholder values) | yes |
55
55
| context | The context in which to listen for the key (see [below](#contexts)) | yes |
56
-
| subprocess | Whether you want the command to run in a subprocess (e.g. if the command requires user input) | no |
57
56
| prompts | A list of prompts that will request user input before running the final command | no |
58
57
| loadingText | Text to display while waiting for command to finish | no |
59
58
| description | Label for the custom command when displayed in the keybindings menu | no |
60
-
| stream | Whether you want to stream the command's output to the Command Log panel | no |
61
-
| showOutput | Whether you want to show the command's output in a popup within Lazygit | no |
62
-
| outputTitle | The title to display in the popup panel if showOutput is true. If left unset, the command will be used as the title. | no |
59
+
| output | Where the output of the command should go. 'none' discards it, 'terminal' suspends lazygit and runs the command in the terminal (useful for commands that require user input), 'log' streams it to the command log, 'logWithPty' is like 'log' but runs the command in a pseudo terminal (can be useful for commands that produce colored output when the output is a terminal), and 'popup' shows it in a popup. | no |
60
+
| outputTitle | The title to display in the popup panel if output is set to 'popup'. If left unset, the command will be used as the title. | no |
63
61
| after | Actions to take after the command has completed | no |
64
62
65
63
Here are the options for the `after` key:
@@ -365,7 +363,7 @@ If you use the commandMenu property, none of the other properties except key and
365
363
366
364
## Debugging
367
365
368
-
If you want to verify that your command actually does what you expect, you can wrap it in an 'echo' call and set `showOutput: true` so that it doesn't actually execute the command but you can see how the placeholders were resolved.
366
+
If you want to verify that your command actually does what you expect, you can wrap it in an 'echo' call and set `output: popup` so that it doesn't actually execute the command but you can see how the placeholders were resolved.
// Label for the custom command when displayed in the keybindings menu
648
645
Descriptionstring`yaml:"description"`
649
-
// If true, stream the command's output to the Command Log panel
650
-
// [dev] Pointer to bool so that we can distinguish unset (nil) from false.
651
-
Stream*bool`yaml:"stream"`
652
-
// If true, show the command's output in a popup within Lazygit
653
-
// [dev] Pointer to bool so that we can distinguish unset (nil) from false.
654
-
ShowOutput*bool`yaml:"showOutput"`
655
-
// The title to display in the popup panel if showOutput is true. If left unset, the command will be used as the title.
646
+
// Where the output of the command should go. 'none' discards it, 'terminal' suspends lazygit and runs the command in the terminal (useful for commands that require user input), 'log' streams it to the command log, 'logWithPty' is like 'log' but runs the command in a pseudo terminal (can be useful for commands that produce colored output when the output is a terminal), and 'popup' shows it in a popup.
"description": "If true, run the command in a subprocess (e.g. if the command requires user input)"
102
-
},
103
99
"prompts": {
104
100
"items": {
105
101
"$ref": "#/$defs/CustomCommandPrompt"
@@ -118,17 +114,20 @@
118
114
"type": "string",
119
115
"description": "Label for the custom command when displayed in the keybindings menu"
120
116
},
121
-
"stream": {
122
-
"type": "boolean",
123
-
"description": "If true, stream the command's output to the Command Log panel"
124
-
},
125
-
"showOutput": {
126
-
"type": "boolean",
127
-
"description": "If true, show the command's output in a popup within Lazygit"
117
+
"output": {
118
+
"type": "string",
119
+
"enum": [
120
+
"none",
121
+
"terminal",
122
+
"log",
123
+
"logWithPty",
124
+
"popup"
125
+
],
126
+
"description": "Where the output of the command should go. 'none' discards it, 'terminal' suspends lazygit and runs the command in the terminal (useful for commands that require user input), 'log' streams it to the command log, 'logWithPty' is like 'log' but runs the command in a pseudo terminal (can be useful for commands that produce colored output when the output is a terminal), and 'popup' shows it in a popup."
128
127
},
129
128
"outputTitle": {
130
129
"type": "string",
131
-
"description": "The title to display in the popup panel if showOutput is true. If left unset, the command will be used as the title."
130
+
"description": "The title to display in the popup panel if output is set to 'popup'. If left unset, the command will be used as the title."
0 commit comments