How to auto switch input method by app
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/