Skip to content

Commit

Permalink
Merge branch 'master' of github.com:okbob/pspg
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Apr 16, 2024
2 parents 2601c96 + 2a42312 commit f5bd3f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions src/pspg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f5bd3f3

Please sign in to comment.