* feat(template): add cmd function to run OS commands from templates
Adds a `cmd` template function that calls env.RunCommand() and
returns trimmed output, enabling users to incorporate arbitrary
command output into any segment template.
Example usage:
{{ cmd "who" | splitList "
" | len }}
{{ cmd "git" "log" "--oneline" "-1" }}
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: restore apm.lock after apm install on session create
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: restore apm.lock after apm install in setup steps
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(template): fix field alignment in exec_test.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(template): add security warning to cmd helper
Warn that cmd executes arbitrary OS commands as the current user and
should only be used with trusted themes/configs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor(template): rename exec to cmd
Rename exec.go -> cmd.go and exec_test.go -> cmd_test.go to match the
template function name. Also rename TestExec -> TestCmd.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>