[OS X Emacs] latex + dvips + ps2pdf from Aquamacs
Ettore Aldrovandi
ealdrov at math.fsu.edu
Mon Nov 2 19:43:16 EST 2020
So it’s working?
The discrepancy is, or might be, that there is a difference between a login and non login shell in their startup mechanisms. It depends on whether you have still disabled .zprofile, which, if I remember correctly, sources .zshrc. This is OK, by the way: my .zprofile doesn’t do anything, and in particular it does not source .zshrc.
Two more comments: bash is very similar in its distinction between login vs. non-login shell and interactive vs. non-interactive. Second, you can go back to bash, if you were using it before, especially if it worked. You can run
chsh -s /bin/bash
It will ask your password. (Or you can use “dscl” for the same effect, but with a different syntax. )
—Ettore
> On Nov 2, 2020, at 16:42, Roussanka Loukanova <rl.stpuu at gmail.com> wrote:
>
> More puzzles, which, perhaps, point to some inconsistencies of Aquamacs PATH, with respect to zsh:
>
> By launching Aquamacs from terminal:
> $ open -a aquamacs
> in Aquamacs *Messages*:
> 23 environment variables imported from login shell (/bin/zsh).
>
> In another Restart of the Mac and launching Aquamacs from Dock:
> In Aquamacs *Messages*, I get alternative number of variables:
>
> 16 environment variables imported from login shell (/bin/zsh).
> or
> 19 environment variables imported from login shell (/bin/zsh).
>
> with the same:
> M-x getenv
> PATH
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Library/TeX/texbin:/usr/local/texlive/2020/bin
>
> Best Regards,
> Roussanka
>
>
>
>
> On Mon, Nov 2, 2020 at 10:25 PM Roussanka Loukanova <rl.stpuu at gmail.com <mailto:rl.stpuu at gmail.com>> wrote:
> Hi Ettore,
>
> did you logout and logged back in?
>
> Yes, 2-3 times, just in case to triple check all those files and PATH and SHELL variables. They are the same, except for the PATH from Aquamacs:
> ----------------
> by moving .zprofile to
> t.zprofile
> keeping:
> .zshrc
>
> in Aquamacs *Messages*:
> 16 environment variables imported from login shell (/bin/zsh).
>
> M-x getenv
> PATH
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Library/TeX/texbin:/usr/local/texlive/2020/bin
> -----------
>
> Alternatively, do you see any difference in the environment if you open a fresh Terminal and run "zsh -l" in it?
>
> Is this the pipe key? Here is what I get:, which seems strange:
>
> ~ $ zsh -|
> pipe> quit
> zsh: command not found: quit
> update_terminal_cwd:printf:21: write error: broken pipe
> update_terminal_cwd:21: write error: broken pipe
> ~ $
>
> I even do not know how to terminate this process, and did it via quitting Terminal, which asked me to terminate it.
>
> I don’t see anything untoward in your .zprofile file.
>
> It looks to me that Aquamacs doesn't do its PATH properly in the presence of the local ~/.zprofile. But this is no proof, just based on my test of moving it away, by moving it to ~/t.zprofile.
>
> It should not make a difference, but can you double check for the presence of a ~/.zshenv?
>
> ~ $ more .zshenv
> .zshenv: No such file or directory
> ~ $
>
> I'm quite puzzled, even with the poor knowledge I have about the zsh and shells. I do not know the syntax of their source code: I just try to handle some minimal code to get the prompt in Terminal explicitly display the full path of the directory where I go. I am still worried about the aliases and the function defined in my ~/.zshrc inherited from my old bash.
>
> Best Regards,
> Roussanka
>
> —Ettore
>
>> On Nov 2, 2020, at 14:30, Roussanka Loukanova <rl.stpuu at gmail.com <mailto:rl.stpuu at gmail.com>> wrote:
>>
>> Hi Ettore and Win,
>>
>> I've done one more test, which seems to improve the PATH value for Aquamacs and allows access to ps2pdf, but I do not know whether this solves the problems, or is just a test with some improvement.
>>
>> ----------------
>> by moving .zprofile to
>> t.zprofile
>> keeping:
>> .zshrc
>>
>> 19 environment variables imported from login shell (/bin/zsh)
>>
>> M-x getenv
>> PATH
>> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Library/TeX/texbin:/usr/local/texlive/2020/bin
>>
>> ~ $ echo $PATH
>> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
>> ~ $
>> ~ $ echo $SHELL
>> /bin/zsh
>>
>> latex+dvi+ps2pdf seem fine from Aquamacs
>>
>> ----------------
>> Best Regards,
>> Roussanka
>>
>>
>>
>>
>> On Mon, Nov 2, 2020 at 7:17 PM Roussanka Loukanova <rl.stpuu at gmail.com <mailto:rl.stpuu at gmail.com>> wrote:
>> Hi Ettore,
>>
>> Sorry I've not been able to answer earlier.
>>
>> Indeed, my ~/.zprofile and ~/.zshrc are interfering and messing up the PATH environment variable, at least in Aquamacs, hopefully not more.
>>
>> I upgraded to Catalina macOS this Summer, and, as prompted by it, I moved from bash to zsh. I created / exported ~/.zprofile and ~/.zshrc from the corresponding ones of bash. I followed whatever the Mac's Catalina prompted me for, read Apple Support:
>> https://support.apple.com/en-us/HT208050 <https://support.apple.com/en-us/HT208050>
>> and some from the zsh website, to which I got from the "man zsh''. Obviously, I didn't get enough details.
>>
>> Here are some tests I've done and the dot files you think would be useful. I would like to get help, feedback, and know what and how. I hope that the upper settings are as they have been from Apple, because I have never attempted to modify them, at least not deliberately.
>>
>> ----------------
>> ----
>> .zprofile
>> --
>> # .zprofile is read by zsh when starting a zsh login shell.
>>
>> # Get the aliases and functions
>> if [ -f ~/.zshrc ]; then
>> . ~/.zshrc
>> fi
>> #
>> --
>> https://support.apple.com/en-us/HT208050 <https://support.apple.com/en-us/HT208050>
>> .zshrc
>> --
>> # .zshrc is read by zsh when starting a non-login, interactive
>> # shell. It is recommended to source it in .zsh_profile so it's
>> # read by login zsh as well.
>>
>> # https://support.apple.com/en-us/HT208050 <https://support.apple.com/en-us/HT208050>
>> # need of export? I see no difference:
>> # export PS1="%10F%m%f:%11F%1~%f \$ "
>> # export PS1="%11F%0~%f \$ "
>> # %n user ; %1 current dir ; %0 path
>> # export PS1="%n %F{red}%0~%f \$ "
>> # export PS1="%F{red}%0~%f \$ "
>> PS1="%F{red}%0~%f \$ "
>>
>> # User specific aliases and functions
>> alias cp="cp -i"
>> alias rm="rm -i"
>> alias mv="mv -i"
>> trash () { mv "$@" ~/.Trash ; }
>>
>> -- with these dot files:
>> in Aquamacs *Messages*:
>> Warning: Login shell did not return environment.
>> 0 environment variables imported from login shell (/bin/zsh).
>> --
>> from Aquamacs:
>> M-x getenv
>> PATH
>> /usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Library/TeX/texbin:/usr/local/texlive/2020/bin
>>
>> ----------------
>> by moving the dot files to
>> t.zprofile
>> t.zshrc
>>
>> Mon Nov 2 16:57:11
>>
>> ~ % echo $SHELL
>> /bin/zsh
>>
>> % echo $PATH
>> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
>> the same as with
>> .zprofile
>> .zshrc
>> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
>>
>> from Aquamacs:
>> M-x getenv
>> PATH
>> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Library/TeX/texbin:/usr/local/texlive/2020/bin
>> ----
>> ----------------
>> ----------------
>>
>>
>> Ouch. It would probably help Wim to check the content of the following files:
>>
>> /etc/paths
>> ~ $ more /etc/paths
>> /usr/local/bin
>> /usr/bin
>> /bin
>> /usr/sbin
>> /sbin
>> ~ $
>> /etc/zprofile
>> ~ $ more /etc/zprofile
>> # System-wide profile for interactive zsh(1) login shells.
>>
>> # Setup user specific overrides for this in ~/.zprofile. See zshbuiltins(1)
>> # and zshoptions(1) for more details.
>>
>> if [ -x /usr/libexec/path_helper ]; then
>> eval `/usr/libexec/path_helper -s`
>> fi
>> ~ $
>>
>> /etc/zshrc
>>
>> ~ $ more /etc/zshrc
>> # System-wide profile for interactive zsh(1) shells.
>>
>> # Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
>> # and zshoptions(1) for more details.
>>
>> # Correctly display UTF-8 with combining characters.
>> if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
>> setopt COMBINING_CHARS
>> fi
>>
>> # Disable the log builtin, so we don't conflict with /usr/bin/log
>> disable log
>>
>> # Save command history
>> HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
>> HISTSIZE=2000
>> SAVEHIST=1000
>>
>> # Beep on error
>> setopt BEEP
>>
>> # Use keycodes (generated via zkbd) if present, otherwise fallback on
>> # values from terminfo
>> if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
>> source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
>> else
>> typeset -g -A key
>>
>> [[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
>> [[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
>> [[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
>> [[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
>> [[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
>> [[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
>> [[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
>> [[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
>> [[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
>> [[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
>> [[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
>> [[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
>> [[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
>> [[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
>> [[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
>> [[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
>> [[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
>> [[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
>> [[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
>> [[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
>> [[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
>> [[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
>> [[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
>> [[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
>> [[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
>> [[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
>> [[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
>> [[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
>> [[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
>> [[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
>> [[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
>> fi
>>
>> # Default key bindings
>> [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
>> [[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
>> [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
>> [[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
>> [[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
>>
>> # Default prompt
>> PS1="%n@%m %1~ %# "
>>
>> # Useful support for interacting with Terminal.app or other terminal programs
>> [ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
>> ~ $
>>
>> ~/.zshenv
>> ~ $ more /.zshenv
>> /.zshenv: No such file or directory
>> ~ $
>>
>> ~/.zshrc
>> ~ $ more .zshrc
>> # .zshrc is read by zsh when starting a non-login, interactive
>> # shell. It is recommended to source it in .zsh_profile so it's
>> # read by login zsh as well.
>>
>> ## test colour:
>> # print -P '%B%F{red}co%F{green}lo%F{blue}rs%f%b'
>>
>> # https://support.apple.com/en-us/HT208050 <https://support.apple.com/en-us/HT208050>
>> # need of export?
>> # export PS1="%10F%m%f:%11F%1~%f \$ "
>> # export PS1="%11F%0~%f \$ "
>> # %n user ; %1 current dir ; %0 path
>> # export PS1="%n %F{red}%0~%f \$ "
>> # export PS1="%F{red}%0~%f \$ "
>> PS1="%F{red}%0~%f \$ "
>>
>> # User specific aliases and functions
>> alias cp="cp -i"
>> alias rm="rm -i"
>> alias mv="mv -i"
>> trash () { mv "$@" ~/.Trash ; }
>> ~ $
>>
>> ~/.zprofile
>> ~ $ more .zprofile
>> # .zprofile is read by zsh when starting a zsh login shell.
>>
>> # Get the aliases and functions
>> if [ -f ~/.zshrc ]; then
>> . ~/.zshrc
>> fi
>> #
>> ~ $
>>
>> ~/.profile
>> ~ $ more .profile
>> .profile: No such file or directory
>> ~ $
>>
>> just in case. We should exclude the possibility that zsh is to blame. More precisely, the difference between a login shell and the non-login one that is executed by the single Terminal instances.
>>
>> I've been learning these days with all this. Thanks for your help!
>>
>> Best Regards,
>> Roussanka
>> —Ettore
>>
>> Ettore Aldrovandi
>> Department of Mathematics, Florida State University
>> 1017 Academic Way * http://www.math.fsu.edu/~ealdrov <http://www.math.fsu.edu/~ealdrov>
>> Tallahassee, FL 32306-4510, USA * * aldrovandi at math dot fsu dot edu
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20201102/bf8c3d63/attachment.htm>
More information about the MacOSX-Emacs
mailing list