将环境变量设置为 iTerm2 徽章
我正在修改 iTerm2,试图实现以下目标:
- 切换到许多配置文件之一(例如工作和个人);
- 根据配置文件的使用情况设置/取消设置环境变量;
- 使徽章读取这些“流利”环境变量中的一个或多个。
目前,我正在通过在每个配置文件会话开始时设置环境变量来进行环境变量的“自动分配”:
export FOO="bar" && export FUZ="buz"
我认为有更好的方法来做到这一点,但这就是我到目前为止想到的。
我正在努力创建一个函数来读取这些环境变量并将它们的值分配给徽章内容。
我在网上读了很多东西,但似乎没什么用。
作为记录,我使用的是 zsh。
如果有配置 iTerm 经验丰富的人可以参与进来,我将不胜感激! :)
I'm tinkering with iTerm2, trying to achieve the following:
- switch to one of many profiles (e.g. work & personal);
- set/unset environment variables based on the usage of the profiles;
- make the badge read one or more of these "fluent" env vars.
Currently, I'm doing the "auto-assignment" of env vars by setting them at the start of each profile session:
Settings -> Profiles -> General -> Send text at start
export FOO="bar" && export FUZ="buz"
I assume there's a better way to do it but that's what I came up with so far.
What I'm struggling with is creating a function that would read these env vars and assign their values to the badge content.
I read a lot of stuff online but nothing seems to work.
For the record, I'm using zsh.
If someone more experienced with configuring iTerm could pitch in, I'd appreciate it! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论