Sample Header Ad - 728x90

iTerm2 color scheme: use alternative background color (41m)

-1 votes
1 answer
250 views
I have set up iTerm2 to change its profile when I ssh to a specific machine. This works as intended (I am using zsh and oh-my-zsh). The main thing I do for this is in my ~/.zshrc file: echo -e "\033]1337;SetProfile=\a" This sets the colors as defined in "Colors" in iTerm2's "Profile". So far, so good. I have downloaded the [color profile called "Harper"](https://iterm2colorschemes.com/) and would like to use it with the "41m column" (in lack of a better term). As far as I understand that basically means I have to set the terminal's background color to "red" (which is what "41m" means). But I cannot figure out how to do this... I have tried (for example): echo -e "\033]1337;SetProfile=\a" echo -e "\033]1337;SetColors=bg=c00\a" or echo -e "\033]1337;SetProfile=\a" echo -e "\033]1337;SetColors=bg=f00\a" Which makes iTerm show a red background and use (for example) the foreground colors defined in the Harper color scheme. But that's not what I want. My question is very similar to (not to say the same) what was asked in a Stackoverflow question: [Iterm2 colors - using the 42m or 41m options](https://stackoverflow.com/q/34257198) . But that question does not have an answer. By the way, I know that most instructions on the Internet seem to use a different OSC command (50 instead of 1337), but according to [iTerm2's documentation](https://iterm2.com/documentation-escape-codes.html) , that is outdated: > The OSC command 50 used to be used but it conflicts with xterm, so it is now 1337. Is it even possible to do what I intend?
Asked by Andreas (1 rep)
Jan 15, 2024, 04:11 PM
Last activity: Jan 18, 2024, 12:26 PM