iTerm Color Scheme | Profile Command

2

2

I'm using prezto with iTerm and in my .zshrc, I have the following line that changes the color scheme:

sh ~/.vim/plugins/gruvbox/gruvbox_256palette_osx.sh

However, sometimes when I click ⌘ + R, I lose the color scheme and I have to execute the command manually. So I was wondering if it was possible to do it automatically.

I've tried putting it into my profile command:

zsh --login && sh ~/.vim/plugins/gruvbox/gruvbox_256palette_osx.sh

However, when I open a new tab of iTerm, I get the error message:

A session ended very soon after starting. Check that the command in profile "Chin" is correct.

Chin Leung

Posted 2017-01-25T18:13:43.737

Reputation: 93

Answers

0

Send text at start: field in Settings/General in your iTerm profile.

enter image description here

start it like this:

source "$HOME/.vim/plugins/gruvbox/gruvbox_256palette_osx.sh"

To resolve the "⌘ + r" issue:

Open up preferences (iTerm > Preferences -or- ⌘,)

Under Keys:

  • Under "Key Mappings", add the following, all of which should have an action of ignore:

⌘t, ⌘r, ⌘w

DeerSpotter

Posted 2017-01-25T18:13:43.737

Reputation: 362

It's works on a new tab / window. However, it doesn't solve the issue of ⌘ + R – Chin Leung – 2017-02-03T02:10:14.653

@chin Leung, is ⌘ + R mapped to a custom function on your mac or terminal? – DeerSpotter – 2017-02-03T16:25:19.930

No it's not in the mapping and I don't want to ignore my ⌘ + R. I need it to remap the screen sometimes. – Chin Leung – 2017-02-04T17:32:34.963

@ChinLeung ill have to play with it more, but it does seem like most people run into your issue. Could you use another command to remap the screen instead? Could you do a simple test to see if screen remapping causes this issue, not the hotkey combination? – DeerSpotter – 2017-02-06T13:37:00.113

Hmm, you want me to remap the command to what? – Chin Leung – 2017-02-06T18:12:35.740

@ChinLeung To some other key combination (⌘ + K). Then see if pressing that combination causes the same error. This way we can rule out that its not ⌘ + R – DeerSpotter – 2017-02-06T19:17:38.913

I'm not sure how I can remap the command. It's a built-in one from iTerm. I can find the command under Edit -> Reset – Chin Leung – 2017-02-06T19:35:38.617