hijkzzz
V2EX  ›  问与答

.zshrc 配置环境变量无效?

  •  
  •   hijkzzz · Dec 2, 2016 · 3380 views
    This topic created in 3652 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
    SpicyCat
    Dec 2, 2016
    1
    zshrc 当然只在终端有效。要想其他软件也有效,那就用命令行启动软件
    hijkzzz
    hijkzzz
    OP
    Dec 9, 2016
    2
    @SpicyCat .bash_profile 好像是全局有效,有什么办法全局有效吗?终端启动太麻烦了,我喜欢 command+space ,谢谢
    SpicyCat
    SpicyCat
    Dec 9, 2016
    3
    mac 用的不多,搜了下,需要修改 /etc/launchd.conf 文件
    http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   911 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:28 · PVG 04:28 · LAX 12:28 · JFK 15:28
    ♥ Do have faith in what you're doing.