hijkzzz
V2EX  ›  问与答

.zshrc 配置环境变量无效?

  •  
  •   hijkzzz · Dec 2, 2016 · 3086 views
    This topic created in 3487 days ago, the information mentioned may be changed or developed.
    macOS Serria + ZSH
    环境变量写在 ~/.zshrc
    但只在 ZSH 终端有效,其他软件中无效
    ~/.zshrc 登录时不自动加载的吗?
    3 replies    2016-12-09 10:35:01 +08:00
    SpicyCat
        1
    SpicyCat  
       Dec 2, 2016
    zshrc 当然只在终端有效。要想其他软件也有效,那就用命令行启动软件
    hijkzzz
        2
    hijkzzz  
    OP
       Dec 9, 2016
    @SpicyCat .bash_profile 好像是全局有效,有什么办法全局有效吗?终端启动太麻烦了,我喜欢 command+space ,谢谢
    SpicyCat
        3
    SpicyCat  
       Dec 9, 2016
    mac 用的不多,搜了下,需要修改 /etc/launchd.conf 文件
    http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   849 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:34 · PVG 06:34 · LAX 15:34 · JFK 18:34
    ♥ Do have faith in what you're doing.