Compare commits

..

No commits in common. "63e7895905a1cc31c5b6881b4738cd04217adbc1" and "000315165df66f23519fd3b503197c9818562d90" have entirely different histories.

2 changed files with 7 additions and 6 deletions

View File

@ -64,7 +64,7 @@ sdn-navigate () {
# helpers after the terminal has been resized while running sdn # helpers after the terminal has been resized while running sdn
command true command true
/bin/sh -c "$helper" </dev/tty || break eval "exec </dev/tty; $helper" || break
done done
# ... possibly zle-line-init # ... possibly zle-line-init
zle reset-prompt zle reset-prompt
@ -86,7 +86,7 @@ function sdn-navigate
test -z "$cd" || cd "$cd" test -z "$cd" || cd "$cd"
test -z "$insert" || commandline --insert "$insert " test -z "$insert" || commandline --insert "$insert "
test -z "$helper" && break test -z "$helper" && break
/bin/sh -c "$helper" || break eval $helper || break
end end
commandline --function repaint commandline --function repaint
end end
@ -111,7 +111,7 @@ sdn-navigate () {
((SDN_P=SDN_P+${#insert}+1)) ((SDN_P=SDN_P+${#insert}+1))
} }
[[ -z "$helper" ]] && break [[ -z "$helper" ]] && break
/bin/sh -c "$helper" || break eval "$helper" || break
done done
} }
sdn-restore () { sdn-restore () {
@ -132,7 +132,7 @@ To start using this navigator, put the following in your 'rc.elv':
use str use str
edit:insert:binding[Alt-o] = { edit:insert:binding[Alt-o] = {
local:reesc = [posix]{ str:replace "'\\''" "''" $posix } local:reesc = [posix]{ str:replace "'\\''" "''" $posix }
local:posix = [cmd]{ /bin/sh -c $cmd </dev/tty >/dev/tty 2>&1 } local:posix = [cmd]{ eval ($reesc $cmd)" </dev/tty >/dev/tty 2>&1" }
# XXX: the -dot is not a stable API, and may hence break soon # XXX: the -dot is not a stable API, and may hence break soon
local:buffer = $edit:current-command local:buffer = $edit:current-command

View File

@ -861,7 +861,8 @@ fun run_program (initializer_list<const char*> list, const string &filename) {
for (auto program : list) for (auto program : list)
if ((found = program)) if ((found = program))
break; break;
g.ext_helper = found + (" " + shell_escape (filename)); g.ext_helper = "/bin/sh -c " +
shell_escape (string (found) + " " + shell_escape (filename));
g.quitting = true; g.quitting = true;
return; return;
} }
@ -887,7 +888,7 @@ fun run_program (initializer_list<const char*> list, const string &filename) {
// We don't provide job control--don't let us hang after ^Z // We don't provide job control--don't let us hang after ^Z
while (waitpid (child, &status, WUNTRACED) > -1 && WIFSTOPPED (status)) while (waitpid (child, &status, WUNTRACED) > -1 && WIFSTOPPED (status))
if (WSTOPSIG (status) == SIGTSTP) if (WSTOPSIG (status) == SIGTSTP)
kill (-child, SIGCONT); kill (child, SIGCONT);
tcsetpgrp (STDOUT_FILENO, getpgid (0)); tcsetpgrp (STDOUT_FILENO, getpgid (0));
if (WIFEXITED (status) && WEXITSTATUS (status)) { if (WIFEXITED (status) && WEXITSTATUS (status)) {