diff --git a/shell/completion.zsh b/shell/completion.zsh
index 7e9f83adbfa8ab342086aeb51cb51a5901d65ae0..3381f463ba9bde1eb89d77ffd2457d177a191429 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -117,6 +117,7 @@ __fzf_extract_command() {
   local token tokens
   tokens=(${(z)1})
   for token in $tokens; do
+    token=${(Q)token}
     if [[ "$token" =~ [[:alnum:]] && ! "$token" =~ "=" ]]; then
       echo "$token"
       return
@@ -275,7 +276,7 @@ fzf-completion() {
 
   tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))}
   # Kill completion (do not require trigger sequence)
-  if [ $cmd = kill -a ${LBUFFER[-1]} = ' ' ]; then
+  if [ "$cmd" = kill -a ${LBUFFER[-1]} = ' ' ]; then
     matches=$(command ps -ef | sed 1d | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --min-height 15 --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS --preview 'echo {}' --preview-window down:3:wrap" __fzf_comprun "$cmd" -m | awk '{print $2}' | tr '\n' ' ')
     if [ -n "$matches" ]; then
       LBUFFER="$LBUFFER$matches"
diff --git a/test/test_go.rb b/test/test_go.rb
index 6f31dcf232961d4c62ddd7313d1c4bdd4eb61a3a..586ddf9f578c7e3cfd76a579729f1361d5b679c4 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2133,6 +2133,18 @@ class TestZsh < TestBase
     tmux.send_keys "FZF_TMUX=1 #{Shell.zsh}", :Enter
     tmux.prepare
   end
+
+  def test_complete_quoted_command
+    tmux.send_keys 'export FZFFOOBAR=BAZ', :Enter
+    ['unset', '\unset', "'unset'"].each do |command|
+      tmux.prepare
+      tmux.send_keys "#{command} FZFFOOBR**", :Tab
+      tmux.until { |lines| lines.match_count == 1 }
+      tmux.send_keys :Enter
+      tmux.until { |lines| lines[-1].include?("#{command} FZFFOOBAR") }
+      tmux.send_keys 'C-c'
+    end
+  end
 end
 
 class TestFish < TestBase