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 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