Created
March 16, 2016 04:59
-
-
Save creamidea/0784194eccc96febbfba to your computer and use it in GitHub Desktop.
调用iTerm,将编码改成gbk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 使用GBK Profile | |
echo -e "\033]50;SetProfile=GBK\a" | |
# 环境编码切换为GBK | |
export LANG=zh_CN.GBK | |
export LC_ALL=zh_CN.GBK | |
# 更改当前 iTerm2 tab title | |
echo -ne "\033]0;"$@"\007" | |
$@ | |
echo -ne "\033]0;"${PWD/#$HOME/~}"\007" | |
# GBK任务完成后,自动切换回默认编码(UTF-8) | |
echo -e "\033]50;SetProfile=Default\a" | |
export LANG=zh_CN.UTF-8 | |
export LC_ALL=zh_CN.UTF-8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment