Re: .unixCmd
miguel.negrao-lists-/wLt9BB+Iy41Tgt60Rntydi2O/[email protected]
| Newsgroups | gmane.comp.audio.supercollider.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, As a solution, one can use absolute paths, e.g. /usr/bin/telnet or read the PATH from a file using ".": cd /tmp mkdir test_path mkdir bin cp /bin/ls bin/myls mkdir home echo PATH=/tmp/test_path/bin > home/.zprofile miguel@linux:/tmp/test_path$ zsh -c "myls" zsh:1: command not found: myls miguel@linux:/tmp/test_path$ zsh -c ". /tmp/test_path/home/.zprofile; myls" bin commands.txt home Also unixCmd I belive calls /bin/sh which in according to this email thread calls zsh. man page for zsh says: "Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc." Given that this is an interactive shell, I think it will not read .zprofile. This page has more info: https://apple.stackexchange.com/questions/388622/zsh-zprofile-zshrc-zlogin-what-goes-where It suggests setting PATH in ".zshrc" . Best, Miguel Às 11:10 de 19/03/21, [email protected] escreveu: > It's not a bug in SC, this is a misunderstanding of how your OS > operates. Each process starts with its own environment provided by the > process which launched it (this may be the kernel itself!). The typical > behavior of a shell is to indeed pass on the current environment to > subprocesses, although this isn't required behavior at all in a UNIX > system. SC itself has no control over the starting environment it > receives, and like many applications it simply operates within that > environment because this is a very useful way to pass some configuration > items. > > SC is not reading your shell config file. Your shell is reading it, and > then SC inherits that environment when your shell starts open, which > starts SC. The man page for open [1] also makes this clear: > > "Opened applications inherit environment variables just as if you had > launched the application directly through its full path." > > One feature we could add to the IDE is the ability to modify certain > environment items in the UI, but it's also easier and more portable > across editors and workflows to call setenv(key, value) in your startup > script. Unless we have a more substantial notion of projects in the IDE, > there's not much benefit to making it more complicated than that, I feel. > > Hope this helps. > > Brian > > [1] https://ss64.com/osx/open.html <https://ss64.com/osx/open.html> > -------- Original Message -------- > On Mar 19, 2021, 11:16 AM, < [email protected]> wrote: > > > yes, something is very wrong here with SuperCollider running under > macOS. > and i believe it has caused a lot of the problems other users > reported here previously - for example with git and quarks. > > if i start SuperCollider.app <http://SuperCollider.app> like normal > by double clicking the icon, and then run... > "echo $PATH".unixCmd; //or "PATH".getenv; > i get /usr/bin:/bin:/usr/sbin:/sbin and it will not pick up the > custom paths i have added in my ~/.zprofile settings file. > > but if i cd to the supercollider directory... > cd /Applications/SuperCollider > and then start the program like this... > open SuperCollider.app <http://SuperCollider.app> > now the above commands WILL read the .zprofile file and acknowledge > the custom paths. > > this of course causes trouble. for example let's say i have > installed htop via homebrew, then the following will return found or > not found depending on how i launched SuperCollider.app > <http://SuperCollider.app>... > "which htop".unixCmd; > and similar... > "which git".unixCmd; > it will either return /usr/local/bin/git (homebrew version) or > /usr/bin/git (the version that macOS ships with) > > maybe i'm missing something obvious here but it does look like nasty > bug. > > so to answer you question... yes, that integer return code means > that your telnet is not found, but try starting SuperCollider.app > <http://SuperCollider.app> from the command line with open. that > should solve your problem until a fix is found. > > (i'm on macOS 10.14.6, SC 3.11.2, zsh shell) > _f > > > 19 mars 2021 kl. 10:13 skrev [email protected]: > > > > dear list! > > > > I’m trying to understand what’s wrong with the .unixCmd and why > the PATH is not the same as in Terminal. > > Basically I want to send "telnet localhost 8000“.unixCmd, and in > SC it gives me only an integer as a result, while in terminal: > > > > telnet localhost 8000 > > Trying ::1... > > Connected to localhost. > > Escape character is '^]‘. > > > > Does it have to do sth with PATH? > > > > thanks for answers! > > > > best, > > Alisa > > > > #| > fredrikolofsson.com <http://fredrikolofsson.com> > musicalfieldsforever.com <http://musicalfieldsforever.com> > |# > > _______________________________________________ > sc-users mailing list > > info (subscription, etc.): > http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx > <http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx> > archive: http://www.listarc.bham.ac.uk/marchives/sc-users > <http://www.listarc.bham.ac.uk/marchives/sc-users>/ > search: http://www.listarc.bham.ac.uk/lists/sc-users/search/ > <http://www.listarc.bham.ac.uk/lists/sc-users/search/> > -- Miguel Negrão http://www.friendlyvirus.org/miguelnegrao _______________________________________________ sc-users mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ search: http://www.listarc.bham.ac.uk/lists/sc-users/search/