commit c3de6524a53dc355b1c8074eb6940e9e73714057
parent 047c22a28cf1ed723791e714b2a5b7c6b4b0e1fc
Author: Kai Ting <kkting@gmail.com>
Date: Sun, 16 Jul 2023 04:15:30 -0700
fix(clipboard): ignore exit caused by signal #23378
Problem:
If clipboard job exits by signal, the exit code is >=128:
https://github.com/neovim/neovim/commit/939d9053bdf2f56286640c581eb4e2ff5a856540
xclip 0.13 often exits with code 143, which spams unhelpful messages:
clipboard: error invoking xclip: Waiting for selection requests,
Control-C to quit Waiting for selection request number 1
Solution:
Don't show a warning if the clipboard tool exit code is >=128.
Fixes: #7054
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
@@ -25,7 +25,8 @@ function! s:selection.on_exit(jobid, data, event) abort
if self.owner == a:jobid
let self.owner = 0
endif
- if a:data != 0
+ " Don't print if exit code is >= 128 ( exit is 128+SIGNUM if by signal (e.g. 143 on SIGTERM))
+ if a:data > 0 && a:data < 128
echohl WarningMsg
echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(self.stderr)
echohl None