| index 659a399..74baf48 100644 | | index 659a399..74baf48 100644 |
| --- a/src/plugin_logs.c | | --- a/src/plugin_logs.c |
| +++ b/src/plugin_logs.c | | +++ b/src/plugin_logs.c |
| @@ -1005,8 +1005,15 @@ static int stream_macos_log(int nlines, const char *filter, | | @@ -1005,8 +1005,15 @@ static int stream_macos_log(int nlines, const char *filter, |
| 1005 | if (mins < 1) mins = 1; | 1005 | if (mins < 1) mins = 1; |
| 1006 | if (mins > 60) mins = 60; | 1006 | if (mins > 60) mins = 60; |
| 1007 | | 1007 | |
| | 1008 | + /* |
| | 1009 | + * Absolute path, and it matters: on macOS `log` is also a zsh shell |
| | 1010 | + * builtin, so a bare `log show` run through a user's shell prints |
| | 1011 | + * "zsh:log: too many arguments" and exits 0 with no output. popen uses |
| | 1012 | + * /bin/sh so it is only latent there, but the fixed path removes the |
| | 1013 | + * class of failure entirely. |
| | 1014 | + */ |
| 1008 | snprintf(cmd, sizeof(cmd), | 1015 | snprintf(cmd, sizeof(cmd), |
| 1009 | - "log show --style compact --last %dm 2>/dev/null | tail -n %d", | 1016 | + "/usr/bin/log show --style compact --last %dm 2>/dev/null | tail -n %d", |
| 1010 | mins, nlines); | 1017 | mins, nlines); |
| 1011 | f = run_cmd(cmd); | 1018 | f = run_cmd(cmd); |
| 1012 | if (!f) return -1; | 1019 | if (!f) return -1; |
| 1013 | | 1020 | |