aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Ting <kkting@gmail.com>2023-07-16 04:15:30 -0700
committerGitHub <noreply@github.com>2023-07-16 04:15:30 -0700
commitc3de6524a53dc355b1c8074eb6940e9e73714057 (patch)
tree56e342a9a02b52c8254e1ef95e1107679cb3aeed
parent047c22a28cf1ed723791e714b2a5b7c6b4b0e1fc (diff)
downloadrneovim-c3de6524a53dc355b1c8074eb6940e9e73714057.tar.gz
rneovim-c3de6524a53dc355b1c8074eb6940e9e73714057.tar.bz2
rneovim-c3de6524a53dc355b1c8074eb6940e9e73714057.zip
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
-rw-r--r--runtime/autoload/provider/clipboard.vim3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 6d238ddb55..6ba28dcbfc 100644
--- 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