static void opstr(char *buf, char *op)
{
- snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c '%s \"$0\" \"$@\" . < /dev/tty' < %s", op, g_selpath);
+ snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c '%s \"$0\" \"$@\" . < /dev/tty' < %s",
+ op, g_selpath);
}
static void rmmulstr(char *buf)
if (r == OK) {
/* Handle all control chars in main loop */
if ((*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^')
- || (*ch == ']' && len == 1)) {
+ || (*ch == '\\')) {
DPRINTF_D(*ch);
DPRINTF_S(keyname(*ch));
/* If there's a filter, try a command on ^P */
- if (cfg.filtercmd && *ch == CONTROL('P') && len > 1) {
+ if (cfg.filtercmd && (*ch == CONTROL('P') || *ch == '\\')
+ && len > 1) {
prompt_run(pln, (ndents ? dents[cur].name : ""), path);
/* Clear the prompt */
wln[--len] = '\0';
wcstombs(ln, wln, REGEX_MAX);
ndents = total;
+ cur = oldcur = 0; /* Ran a command, refresh */
if (matches(pln) != -1)
redraw(path);
for (i = 0; i < CTX_MAX; ++i)
if ((fwrite(&g_ctx[i].c_cfg, sizeof(settings), 1, fsession) != 1)
|| (fwrite(&g_ctx[i].color, sizeof(uint), 1, fsession) != 1)
- || (header.nameln[i] > 0 && fwrite(g_ctx[i].c_name, header.nameln[i], 1, fsession) != 1)
- || (header.lastln[i] > 0 && fwrite(g_ctx[i].c_last, header.lastln[i], 1, fsession) != 1)
- || (header.fltrln[i] > 0 && fwrite(g_ctx[i].c_fltr, header.fltrln[i], 1, fsession) != 1)
- || (header.pathln[i] > 0 && fwrite(g_ctx[i].c_path, header.pathln[i], 1, fsession) != 1))
+ || (header.nameln[i] > 0
+ && fwrite(g_ctx[i].c_name, header.nameln[i], 1, fsession) != 1)
+ || (header.lastln[i] > 0
+ && fwrite(g_ctx[i].c_last, header.lastln[i], 1, fsession) != 1)
+ || (header.fltrln[i] > 0
+ && fwrite(g_ctx[i].c_fltr, header.fltrln[i], 1, fsession) != 1)
+ || (header.pathln[i] > 0
+ && fwrite(g_ctx[i].c_path, header.pathln[i], 1, fsession) != 1))
goto END;
status = TRUE;
for (; i < CTX_MAX; ++i)
if ((fread(&g_ctx[i].c_cfg, sizeof(settings), 1, fsession) != 1)
|| (fread(&g_ctx[i].color, sizeof(uint), 1, fsession) != 1)
- || (header.nameln[i] > 0 && fread(g_ctx[i].c_name, header.nameln[i], 1, fsession) != 1)
- || (header.lastln[i] > 0 && fread(g_ctx[i].c_last, header.lastln[i], 1, fsession) != 1)
- || (header.fltrln[i] > 0 && fread(g_ctx[i].c_fltr, header.fltrln[i], 1, fsession) != 1)
- || (header.pathln[i] > 0 && fread(g_ctx[i].c_path, header.pathln[i], 1, fsession) != 1))
+ || (header.nameln[i] > 0
+ && fread(g_ctx[i].c_name, header.nameln[i], 1, fsession) != 1)
+ || (header.lastln[i] > 0
+ && fread(g_ctx[i].c_last, header.lastln[i], 1, fsession) != 1)
+ || (header.fltrln[i] > 0
+ && fread(g_ctx[i].c_fltr, header.fltrln[i], 1, fsession) != 1)
+ || (header.pathln[i] > 0
+ && fread(g_ctx[i].c_path, header.pathln[i], 1, fsession) != 1))
goto END;
*path = g_ctx[cfg.curctx].c_path;
"cC Execute entry R ^V Pick plugin\n"
"cU Manage session = Launch app\n"
"cc SSHFS mount u Unmount\n"
- "9] ^P Prompt/run cmd L Lock\n"};
+ "9\\ ^P Prompt/run cmd L Lock\n"};
fd = create_tmp_file();
if (fd == -1)