diff --git a/spec/special_characters_spec.rb b/spec/special_characters_spec.rb index 21f681b..ce7810b 100644 --- a/spec/special_characters_spec.rb +++ b/spec/special_characters_spec.rb @@ -51,5 +51,10 @@ describe 'a special character in the buffer' do session.send_string('echo "^A') wait_for { session.content }.to eq('echo "^A"') end + + with_history('-foo() {}') do + session.send_string('-') + wait_for { session.content }.to eq('-foo() {}') + end end end diff --git a/spec/terminal_session.rb b/spec/terminal_session.rb index a089d27..8cbbac0 100644 --- a/spec/terminal_session.rb +++ b/spec/terminal_session.rb @@ -26,7 +26,7 @@ class TerminalSession end def send_string(str) - tmux_command("send-keys -t 0 -l '#{str.gsub("'", "\\'")}'") + tmux_command("send-keys -t 0 -l -- '#{str.gsub("'", "\\'")}'") self end diff --git a/src/async.zsh b/src/async.zsh index 3c3cf84..124c9ac 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -55,7 +55,7 @@ _zsh_autosuggest_async_response() { local suggestion zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null - zle autosuggest-suggest "${suggestion%%$'\0'##}" + zle autosuggest-suggest -- "${suggestion%%$'\0'##}" } _zsh_autosuggest_async_pty_create() { diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 0a33006..34ca080 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -550,7 +550,7 @@ _zsh_autosuggest_async_response() { local suggestion zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null - zle autosuggest-suggest "${suggestion%%$'\0'##}" + zle autosuggest-suggest -- "${suggestion%%$'\0'##}" } _zsh_autosuggest_async_pty_create() {