I installed popclip, added the Title case extension, highlight some text in a cell in Numbers, clicked on the icon for title case, and it worked. however it also put the output of the uptime command in front of my text, which currently looks like this:
I found the cause, but I’m not happy about it. When the extension runs, instead of using a non-interactive shell to run the Perl script, it’s using a full interactive login shell; I can tell because my ~/.zlogin is being run which, among other things, runs the uptime command. So I’d call this a bug in the extension; it shouldn’t be running an interactive login shell.
We need to get to the bottom of this together. PopClip runs the titlecase.pl script in your login shell environment but it should not be doing so interactively.
PopClip calls extension scripts as follows:
First it looks for the value of the SHELL variable in PopClip’s environment variables (e.g. /bin/zsh)
Then it calls that interpreter with the arguments -lc followed by the script path: E.g.
/bin/zsh -lc /path/to/titlecase.pl
Note that -l indicates a login shell and -c indicates a non-interactive shell.
So PopClip does not use an interactive login shell, only a login shell.
What shell do you use and does it support the -c argument to specify non-interactive?
Edit: see below instead
I’m thinking you might be wanting PopClip to use a non-login shell rather than a non-interactive shell, since .zlogin is run at the launch of a zsh login shell. (Commands to be run at the start of an interactive shell go in .zshrc.)
If that is the case, there is an option for this. You can set a hidden pref as follows, in Terminal:
Now it will call it with only the -c option, for all extensions. It shouldn’t break any of the official extensions.
(The reason it uses a login shell by default is that many of the custom extensions people write for themselves are calling tools in the user’s PATH and generally expect a login shell environment.)
Alternatively, you could put your startup commands intended for interactive shell only in .zshrc instead of .zlogin, then they will never get run by PopClip.
ok, yes, I’m moving “uptime” from .zlogin to .zshrc. I’m wondering why I’ve never had trouble with this before. I do remote commands over ssh and various other non-interactive things