12/27/2023 0 Comments Iterm2 themes![]() When creating a profile you can customise colors, fonts etc. Purposes of this each of these profiles is essentially the theme you want to use. usr/bin/ssh " order to work it requires you to create three profiles in iTerm2, and for the # To use this either put this script or a symlink to it into /usr/local/bin # author: # Github: kiyanwang containsElement () '`)Ĭhange_profile " $SSH_DANGER_THEME" elif containsElement " $ HOSTNAME" " thenĬhange_profile " $SSH_WARNING_THEME" else case $ HOSTNAME in # use this block to add any additional hosts For this to work I've inlined the iterm2_set_user_var function from # the iterm shell integrations collection of tools. That way I can always tell what each session is # connected to. # I've updated this recently to take advantage of iTerm's Badges feature to watermark # my terminal session with the hostname. # The script parses the hostname out of the ssh connection string (naive) and # uses this in a case statement to set the theme. Within the Profile you can set the color/themes you wish to use. # You'll need to export three environment variables: # - SSH_DEFAULT_THEME # - SSH_DANGER_THEME # - SSH_WARNING_THEME # The values for these must correspond exactly to the name of an iTerm Profile you have # created. # Simple script that switches your iTerm2 Profile when using ssh. Would tell iTerm2 when to switch themes so that we can use different colors for The solution I came up with was to implement a wrapper around an ssh command that Terminal which has always felt particularly limited. I started using iTerm2 as my terminal emulator instead of the built in SolutionĪll of my development work is done on a Macbook Pro running macOS. These were production boxes and which were servers in our development account. We can find ourselves needing to SSH onto boxes across these various accounts.įor me it is not uncommon to be connected to multiple machines across theseĪccounts, and what I found myself needing was a way to quickly tell which of Production infrastructure from development/staging infrastructure. This is spread over multiple accounts, which exist to separate our In this post I describe how I configured my shell to automaticallyĬhange my terminal theme when I connect to a remote machine in any of our AWS accounts.Īs I’ve mentioned previously, at Talis, we run most of our infrastructure This is the second in a series of posts on useful bash aliases and shellĬustomisations that developers here at Talis use for their own personal But we are hackers and hackers have black terminals with green font colors ~ John Nunemaker
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |