From f7082ee034fbeb677611cefddefac1028ff96ecf Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 29 Mar 2013 17:57:29 -0700 Subject: [PATCH] Make xsel work as designed Fixes https://github.com/fish-shell/fish-shell/issues/559 --- kill.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kill.cpp b/kill.cpp index 2f6790d87..9816e4591 100644 --- a/kill.cpp +++ b/kill.cpp @@ -57,7 +57,7 @@ static wchar_t *cut_buffer=0; */ static int has_xsel() { - static int res=-1; + static signed char res=-1; if (res < 0) { res = !! path_get_path(L"xsel", NULL); @@ -103,10 +103,10 @@ void kill_add(const wcstring &str) const env_var_t disp_wstr = env_get_string(L"DISPLAY"); if (!disp_wstr.missing()) { - escaped_str = escape(str.c_str(), 1); - cmd.assign(L"echo "); + escaped_str = escape_string(str, ESCAPE_ALL); + cmd.assign(L"echo -n "); cmd.append(escaped_str); - cmd.append(L"|xsel -b"); + cmd.append(L" | xsel -i -b"); } }