Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Quote the variables in i3-sensible-* correctly
Browse files Browse the repository at this point in the history
Previously, the variables $EDITOR, $PAGER, $TERMINAL and $VISUAL got
shell-expanded twice before executing them.
  • Loading branch information
tbu- committed Nov 30, 2015
1 parent a2b20c8 commit a5b2c91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions i3-sensible-editor
Expand Up @@ -9,8 +9,8 @@
# mechanism to find the preferred editor

# Hopefully one of these is installed (no flamewars about preference please!):
for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do
if command -v $editor > /dev/null 2>&1; then
exec $editor "$@"
for editor in "$VISUAL" "$EDITOR" nano vim vi emacs pico qe mg jed gedit mc-edit; do
if command -v "$editor" > /dev/null 2>&1; then
exec "$editor" "$@"
fi
done
6 changes: 3 additions & 3 deletions i3-sensible-pager
Expand Up @@ -11,8 +11,8 @@
# Hopefully one of these is installed (no flamewars about preference please!):
# We don't use 'more' because it will exit if the file is too short.
# Worst case scenario we'll open the file in your editor.
for pager in $PAGER less most w3m pg i3-sensible-editor; do
if command -v $pager > /dev/null 2>&1; then
exec $pager "$@"
for pager in "$PAGER" less most w3m pg i3-sensible-editor; do
if command -v "$pager" > /dev/null 2>&1; then
exec "$pager" "$@"
fi
done
6 changes: 3 additions & 3 deletions i3-sensible-terminal
Expand Up @@ -8,9 +8,9 @@
# We welcome patches that add distribution-specific mechanisms to find the
# preferred terminal emulator. On Debian, there is the x-terminal-emulator
# symlink for example.
for terminal in $TERMINAL x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do
if command -v $terminal > /dev/null 2>&1; then
exec $terminal "$@"
for terminal in "$TERMINAL" x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do
if command -v "$terminal" > /dev/null 2>&1; then
exec "$terminal" "$@"
fi
done

Expand Down

0 comments on commit a5b2c91

Please sign in to comment.