From 299c4aa8ce95ed26520e06f09120d6a319999ac6 Mon Sep 17 00:00:00 2001 From: kt programs Date: Mon, 30 Jan 2023 10:46:24 +0800 Subject: [PATCH] docs: add info on asterisk (*) restore option --- docs/restoring_programs.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/restoring_programs.md b/docs/restoring_programs.md index c142fe5..6d316d6 100644 --- a/docs/restoring_programs.md +++ b/docs/restoring_programs.md @@ -28,6 +28,10 @@ contains space-separated list of additional programs to restore. set -g @resurrect-processes 'some_program "grunt->grunt development"' +- Use `*` to expand the arguments from the saved command when restoring: + + set -g @resurrect-processes 'some_program "~rails server->rails server *"' + - Don't restore any programs: set -g @resurrect-processes 'false' @@ -96,6 +100,20 @@ command name". Full (long) process name is now ignored and you'll see just `rails server` in the command line when the program is restored. +> What is asterisk `*` and why is it used? + +(Please read the above clarifications about tilde `~` and arrow `->`). + +Continuing with the `rails server` example, you might have added flags for e.g. +verbose logging, but with the above configuration, the flags would be lost. + +To preserve the command arguments when restoring, use the asterisk `*`: (**note**: there **must** be a space before `*`) + + set -g @resurrect-processes '"~rails server->rails server *"' + +This option says: "when this process is restored use `rails server` as the +command name, but preserve its arguments". + > Now I understand the tilde and the arrow, but things still don't work for me Here's the general workflow for figuring this out: