How to auto switch input method by app My mac has several input methods (English, Chinese)

When I open terminal / iterm2 , I want the input method to switch to English  automatically.

When I open skype or chat messenger , I want the input method to switch to Chinese automatically.
I have the same problem and solve it by the following approach.


  
  choose System Preferences
  select the Keyboard option
  Select the Input Sources tab, and then check the box next to Automatically switch to a document’s input source option
  


Source: https://www.tech-recipes.com/rx/53194/os-x-switch-language-input-sources-automatically/