From 6449b6690d3f9f9c1bfec2360949f2aa6245f108 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 2 May 2015 12:13:43 -0400 Subject: v-editor: cut down on forking --- v-editor.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v-editor.sh b/v-editor.sh index 2d0f52f..7a4e050 100644 --- a/v-editor.sh +++ b/v-editor.sh @@ -6,9 +6,9 @@ run() { if [[ $# -gt 0 ]]; then printf -v args -- ' %q' "$@" fi - eval "${prog}${args}" + eval exec -- "${prog}${args}" } -(if [ -n "$DISPLAY" ]; then run "${VISUAL:-$SELECTED_EDITOR}" "$@" - else run "${EDITOR:-$SELECTED_EDITOR}" "$@" - fi) || run "${ALTERNATE_EDITOR:-false}" "$@" +{ if [ -n "$DISPLAY" ]; then run "${VISUAL:-$SELECTED_EDITOR}" "$@" + else run "${EDITOR:-$SELECTED_EDITOR}" "$@" + fi } || run "${ALTERNATE_EDITOR:-false}" "$@" -- cgit v1.2.3-2-g168b