-
-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Second attempt at #1566 #1570
Second attempt at #1566 #1570
Conversation
I see the following problem with this: I have an entry in I have a file: When I press
I have also modified static void run_cmd_as_plugin(const char *file, char *runfile, uchar_t flags)
{
size_t len;
xstrsncpy(g_buf, file, PATH_MAX);
len = xstrlen(g_buf);
if (len > 1 && g_buf[len - 1] == '*') {
flags &= ~F_CONFIRM; /* Skip user confirmation */
g_buf[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
--len;
}
if (flags & F_PAGE) {
get_output(g_buf, NULL, NULL, -1, TRUE);
#if 0
if ((flags & F_PAGE) || (flags & F_NOTRACE)) {
if (is_suffix(g_buf, " $nnn"))
g_buf[len - 5] = '\0';
else
runfile = NULL;
if (flags & F_PAGE)
get_output(g_buf, runfile, NULL, -1, TRUE);
else // F_NOTRACE
spawn(g_buf, runfile, NULL, NULL, flags);
#endif
} else
spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
} |
You used |
I don't get it. You mentioned:
Can you share the steps you meant? My |
In this case I wanted to page the output as well as complete the copy operation. |
OK. I changed:
to
and it worked. Is this what you meant? |
Let me use this for some more time and if there are no issues, I'll merge. |
That's exactly it. I updated the main comment to better reflect what the change compared to the previous PR is. |
Thank you! |
Thanks @KlzXS! This is a great improvement. |
get_output()
no longer usesUTIL_SH_EXEC
since that presented the usual shell expansion problems. Now it directly invoked the command.Tried it out with the examples of failing commands in #1566 and those seem fine now.
BTW sorry for the terrible commit message. Didn't realize it wouldn't allow me to merge all the commits again. Besides a bunch of "Revert 'Revert ...'" is not that pretty.