diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-02 12:13:43 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-02 12:13:43 -0400 |
commit | 6449b6690d3f9f9c1bfec2360949f2aa6245f108 (patch) | |
tree | 086ef475029c544bb499c58c731e2687663330a1 | |
parent | 4d89628dc246e8c0b40cac48cadebd9e38335dba (diff) |
v-editor: cut down on forking
-rw-r--r-- | v-editor.sh | 8 |
1 files 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}" "$@" |