From f992243bd0cb887d68da619e910d3a26390ebddd Mon Sep 17 00:00:00 2001 From: gbouzas Date: Mon, 15 Apr 2024 22:02:50 +0000 Subject: [PATCH 1/2] try to find `clip.exe` before `xclip` --- src/pspg.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/pspg.c b/src/pspg.c index 4427ed7..5fff17c 100644 --- a/src/pspg.c +++ b/src/pspg.c @@ -1871,6 +1871,19 @@ check_clipboard_app(Options *opts, bool *force_refresh) *force_refresh = true; + errno = 0; + f = popen("clip.exe /? 2>&1", "r"); + if (f) + { + /* first row of output is empty line, just ignore it */ + status = pclose(f); + if (status == 0) + { + clipboard_application_id = 4; + return; + } + } + errno = 0; f = popen("xclip -version 2>&1", "r"); if (f) @@ -1894,19 +1907,6 @@ check_clipboard_app(Options *opts, bool *force_refresh) } } - errno = 0; - f = popen("clip.exe /? 2>&1", "r"); - if (f) - { - /* first row of output is empty line, just ignore it */ - status = pclose(f); - if (status == 0) - { - clipboard_application_id = 4; - return; - } - } - /* * pbcopy has not an argument for returning * version info, and without arguments, it From df0c07f2b0c15c94c4d7b9f4c87203dc218efd37 Mon Sep 17 00:00:00 2001 From: gbouzas Date: Mon, 15 Apr 2024 22:04:26 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4b6534..225713b 100644 --- a/README.md +++ b/README.md @@ -465,7 +465,7 @@ some horizontal scrolling) or on first column. After last column searching start ## Export & Clipboard For clipboard support the clipboard application should be installed: 1. wl-clipboard (Wayland), -2. xclip (xwindows), 3. pbcopy (MacOS) or 4. clip (WSL2). +2. xclip (xwindows), 3. pbcopy (MacOS) or 4. clip.exe (WSL2). `pspg` try to translate unicode symbol '∅' to NULL every time. If you don't use special setting by `\pset null ...`, then `psql` displays empty string instead NULL. `pspg` hasn't any special