text 在SSH连接到另一台机器时更改iTerm2配置文件(即:背景颜色)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在SSH连接到另一台机器时更改iTerm2配置文件(即:背景颜色)相关的知识,希望对你有一定的参考价值。

# Changing iTerm2 profile in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas)
# Adapted from https://gist.github.com/porras/5856906
# 1. Create a profile in your terminal setting with the name "SSH" and the desired colors, background, etc. 
#    (iTerm2 > Profiles > Open Profiles > Edit Profiles)
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;))
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to
#    "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with
#    the SSH colors)

function tabc() {
  NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change
                                                      # "Default" to the name of your default theme
  echo -e "\033]50;SetProfile=$NAME\a"
}

function colorssh() {
  tabc SSH
  ssh $*
  tabc
}

alias ssh="colorssh"

# This would be easy to extend to check if a theme with the name of the server exists and set it, and
# fall back to the SSH theme. This way you can have different colors for different remote environments
# (per project, production, staging, etc.)

以上是关于text 在SSH连接到另一台机器时更改iTerm2配置文件(即:背景颜色)的主要内容,如果未能解决你的问题,请参考以下文章

尽管主机说它正在侦听端口,但无法使用 drda 连接到另一台机器上的 informix

连接到 ssh 远程主机(在 *** 网络中)超时

无法从另一台机器连接到 Geth 节点 RPC

不使用密码的SSH连接

Bot Emulator 连接到另一台机器上的 Node.js 服务

禁用“允许远程连接到此服务器”后,我仍然可以从另一台机器连接