summaryrefslogtreecommitdiff
path: root/v-editor.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-02 12:13:43 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-02 12:13:43 -0400
commit6449b6690d3f9f9c1bfec2360949f2aa6245f108 (patch)
tree086ef475029c544bb499c58c731e2687663330a1 /v-editor.sh
parent4d89628dc246e8c0b40cac48cadebd9e38335dba (diff)
v-editor: cut down on forking
Diffstat (limited to 'v-editor.sh')
-rw-r--r--v-editor.sh8
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}" "$@"