[心得] MacOS 神器之iterm经验

踩过了坑,就让后来者少一些困惑。
要想实现狗皮膏药的这种效果

user@
localhost:
pwd
Mac神器Iterm2的Shell Integration
注意项一:

curl -L https://iterm2.com/misc/install_shell_integration.sh | bash
在服务器和本机都要执行这条命令,或者是通过“Iterm2"->"Install Shell Integration"来执行这条命令,执行完毕之后,会发现无论是服务器、还是本机在“命令提示符”最前面有一个蓝色的小三角块(When shell integration is enabled, iTerm2 automatically adds a mark at each command prompt. Marks are indicated visually by a small blue triangle in the left margin.)

hostname -f
对于没有hostname的,在bash_profile里面这样处理:

show_hostname() {
  echo "kisops.com"
}
alias hostname=show_hostname

在profile badge里面填上:
\(session.username)@\n\(session.hostname):\n\(session.path)
效果就出来了,就是这么简单。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值