3 ms·
> let alone automated profile switching. Personally, I wanted to use it for making the terminal look different (different background colour) when switching to
by mhurron 10y ago
> let alone automated profile switching.
Personally, I wanted to use it for making the terminal look different (different background colour) when switching to a root shell. Then I found I would have to install the shell integration in the root environment of every host I would ever admin. That turns it into a useless feature.
- falcolas 10y agoYeah, I should have clarified - useless for use on remote servers, for the reasons you mention. :)
- mw6621 10y agoYou don't have to install anything to do color switching, AFAIK. There are configuration options that you can use to match based on regexp, so you tell it when it sees '^root@hostname' it needs to change the background color and you are done.
- mhurron 10y agoIt seems like you should be able to do that because it allows regex matching for other things, but to do profile switching, you must have shell integration installed. https://iterm2.com/documentation-automatic-profile-switching.html https://iterm2.com/documentation-automatic-profile-switching...
- xoa 10y agoWhy not just do this in your personal shell theme? When I made my own when I got finally got serious about refreshing my ZSH environment years back, one of the first things I made sure to have was that a root shell was well highlighted with a bright red. You can build your prompt with a conditional %(!.true.false) for whether the shell is running with privileges, and/or different conditionals for whether the shell is a specific UID. Section 13.3 of the manual covers conditional substrings in prompts, and it makes for a pretty flexible foundation to add visual cues under various conditions. This in turn leads to the core major issue I've always had with something like iTerm: ultimately it's a struggle to find much supplied by a higher level GUI application that I can't do and for that matter wouldn't much prefer to do purely within the shell. Of course, the given terminal does need to be capable of handling the basics, in terms of full color, UTF and all that, and there was a time where iTerm was well ahead of Terminal.app there. But I think since at least OS X 10.8 or so Terminal.app has been good enough that zsh/tmux etc can handle the rest, and the result is a setup that's a lot more flexible in terms of what systems it will work on and can be work on from. And that seems like a pretty valuable point of CLI in and of itself. Stuff like the password manager actually does interest me as a stop-gap for servers where I'm unable to have proper shared keys, but a lot of what they list almost seem like anti-features, replicating (poorly or not) stuff better done within the environment in a non-portable way.