2015-05-31 21:46:17 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
Set $RVSEL before running a subprocess.
diff --git a/rover.1 b/rover.1 index 2d8241f..023f4b4 100644 --- a/rover.1 +++ b/rover.1 @@ -166,6 +166,12 @@ Name of pager program (e.g. \fIless\fP). .TP .B EDITOR Name of editor program (e.g. \fIvim\fP or \fIemacs\fP). +.TP +.B RVSEL +Rover writes the name of the selected entry to this variable before running a +subprocess. This allows one to use the selection as part of an arbitrary command +by first invoking a shell from Rover (see the \fBCOMMANDS\fR section) and then +typing something like \fBgrep abc "$RVSEL"\fR. .SH CONFIGURATION .PP If you want to change Rover key bindings or colors, you can edit the diff --git a/rover.c b/rover.c index f390076..4a5371e 100644 --- a/rover.c +++ b/rover.c @@ -254,6 +254,7 @@ spawn() pid_t pid; int status; + setenv("RVSEL", rover.nfiles ? ENAME(ESEL) : "", 1); pid = fork(); if (pid > 0) { /* fork() succeeded. */