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/docs/customwidgets.mdx
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,19 +96,27 @@ The `WidgetConfigType` takes the usual options common to all widgets. The `MetaT
96
96
| "view" | A string that specifies the general type of widget. In the case of custom terminal widgets, this must be set to `"term"`. |
97
97
| "controller" | A string that specifies the type of command being used. For more persistent shell sessions, set it to "shell". For one off commands, set it to `"cmd"`. When `"cmd"` is set, the widget has an additional refresh button in its header that allows the command to be re-run. |
98
98
| "cmd" | (optional) When the `"controller"` is set to `"cmd"`, this option provides the actual command to be run. Note that because it is run as a command, there is no shell session unless you are launching a command that contains a shell session itself. Defaults to an empty string. |
99
+
| "cmd:args" | (optional, array of strings) arguments to pass to the `cmd`|
100
+
| "cmd:shell" | (optional) if cmd:shell if false (default), then we use `cmd` + `cmd:args` (suitable to pass to `execve`). if cmd:shell is true, then we just use `cmd`, and cmd can include spaces, and shell syntax (like pipes or redirections, etc.) |
99
101
| "cmd:interactive" | (optional) When the `"controller"` is set to `"term", this boolean adds the interactive flag to the launched terminal. Defaults to false. |
100
102
| "cmd:login" | (optional) When the `"controller"` is set to `"term"`, this boolean adds the login flag to the term command. Defaults to false. |
101
-
| "cmd:runonstart" | (optional) The command will rerun when the app is started. Without it, you must manually run the command. Defaults to true.|
103
+
| "cmd:runonstart" | (optional) The command will rerun when the block is created or the app is started. Without it, you must manually run the command. Defaults to true. |
102
104
| "cmd:runonce" | (optional) Runs on start, but then sets "cmd:runonce" and "cmd:runonstart" to false (so future runs require manual restarts) |
103
105
| "cmd:clearonstart" | (optional) When the cmd runs, the contents of the block are cleared out. Defaults to false. |
104
106
| "cmd:closeonexit" | (optional) Automatically closes the block if the command successfully exits (exit code = 0) |
105
107
| "cmd:closeonexitforce" | (optional) Automatically closes the block if when the command exits (success or failure) |
106
108
| "cmd:closeonexitdelay | (optional) Change the delay between when the command exits and when the block gets closed, in milliseconds, default 2000 |
107
-
| "cmd:env" | (optional) A key-value object represting environment variables to be run with the command. Currently only works locally. Defaults to an empty object. |
109
+
| "cmd:env" | (optional) A key-value object represting environment variables to be run with the command. Defaults to an empty object.|
108
110
| "cmd:cwd" | (optional) A string representing the current working directory to be run with the command. Currently only works locally. Defaults to the home directory. |
109
111
| "cmd:nowsh" | (optional) A boolean that will turn off wsh integration for the command. Defaults to false. |
110
112
| "term:localshellpath" | (optional) Sets the shell used for running your widget command. Only works locally. If left blank, wave will determine your system default instead. |
111
113
| "term:localshellopts" | (optional) Sets the shell options meant to be used with `"term:localshellpath"`. This is useful if you are using a nonstandard shell and need to provide a specific option that we do not cover. Only works locally. Defaults to an empty string. |
114
+
| "cmd:initscript" | (optional) for "shell" controller only. an init script to run before starting the shell (can be an inline script or an absolute local file path) |
115
+
| cmd:initscript.sh" | (optional) same as `cmd:initscript` but applies to bash/zsh shells only |
116
+
| cmd:initscript.bash" | (optional) same as `cmd:initscript` but applies to bash shells only |
117
+
| cmd:initscript.zsh" | (optional) same as `cmd:initscript` but applies to zsh shells only |
118
+
| cmd:initscript.pwsh" | (optional) same as `cmd:initscript` but applies to pwsh/powershell shells only |
119
+
| cmd:initscript.fish" | (optional) same as `cmd:initscript` but applies to fish shells only |
0 commit comments