Forked from themoriarty/ssh-host-color.sh
iterm2 version 3.0.0 fix error `44:52: syntax error: end of line があるべきところですが identifier が見つかりました。 (-2741)`
Ansi 0 Color Blue Component 0.4716187 Green Component 0.8171692 Red Component 0.9102478 Ansi 1 Color Blue Component 0.7642517 Green Component 0.9198761 Red Component 0.036438 Ansi 10 Color Blue Component 0.3742676 Green Component 0.0227661 Red Component 0.4055786 Ansi 11 Color Blue Component 0. 1,258 3 3 gold badges 14 14 silver badges 21 21 bronze badges More likely you are exporting this value somewhere in your shell login scripts. Did you have a look at.profile etc? None of these worked for me in iterm2 Build 3.0.14 on macOS Sierra 10.12.3 (16D32). They either overwrote what I put in my PS1 entry or did nothing whatsoever. My tabs and indeed my iterm2 window were always just named 'bash'. I'm trying to get the full working directory in the tab name. ITerm.app has come a long way since it was released more than a year ago. We have spent considerable amount of time adding features, fixing bugs, and making it faster and more robust. We believe we have a great relationship with the user community and respond quickly to their bug reports and feature requests. Timing 1 7 5.
ssh-host-color.sh
#!/bin/bash |
# https://gist.github.com/themoriarty/584b759513c5c5864dac |
# |
# (1) copy to: ~/bin/ssh-host-color |
# (2) set: alias ssh=~/bin/ssh-host-color |
# |
# Inspired from http://talkfast.org/2011/01/10/ssh-host-color |
# Fork from https://gist.github.com/773849 |
# |
set_term_bgcolor(){ |
local R=$1 |
local G=$2 |
local B=$3 |
/usr/bin/osascript <<EOF |
tell application 'iTerm' |
tell current session of current window |
set background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))} |
end tell |
end tell |
EOF |
} |
if [[ '$@'=~ thomd ]];then |
set_term_bgcolor 40 0 0 |
elif [[ '$@'=~ git ]];then |
set_term_bgcolor 0 40 0 |
fi |
trap'set_term_bgcolor 0 0 0' EXIT |
ssh $@ |
commented Jun 10, 2016
maybe current terminal is removed https://github.com/gnachman/iTerm2/blob/v3.0.0/sources/AppleScriptTest.m#L175-L176 |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Fancy Utilities
- Paste history: ⌘ + Shift + h
- Instant Replay: ⌘ + Opt + b
- Mouseless selection: ⌘ + f; Tab
- Smart select: Quad-Click
- Rectangle Select: ⌘ + Opt + Select
- Open link (URL/File): ⌘ + Click
Window management
- Reset (cleat window): ⌘ + r
Tab Management
- Full screen: ⌘ + Enter
- New Tab: ⌘ + t
- Jump between tabs: ⌘ + → and ⌘ + ←
- Exposé tabs: ⌘ + Opt + e
Pane management
- Split vertical (New pane): ⌘ + d
- Split horizontal (New pane): ⌘ + Shift + d
- Jump between panes: ⌘ + [ and ⌘ + ] or ⌘ + Opt + →/←/↓/↑
- Enlarge current pane: ⌘ + Shift + Enter
Tmux Support
Run
tmux -CC
, iTerm2 native commands will be interpreted as tmux commands.Moving around
- Support for all readline commands
- Move cursor at point: Opt + Click