[心得] MacOS 神器之iterm经验

来源:互联网 发布:java防止表单重复提交 编辑:程序博客网 时间:2024/05/20 13:19

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

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