Is there any way of forcing input language set to default one on terminal/iterm focus?

Basically what I want to achieve is setting current keyboard input language to English on switching back from other programs. Scripting solutions would work as well.

  • Can you explain it clearly ? Commented Jun 22, 2018 at 7:30
  • 2
    Hey, sure. For example: I'm typing in English in terminal window. Then switching to skype and chat w/ someone in other language. After that I wanna switch back to terminal and continue typing in English, but I need to change language back to English first. What I want is to switch language into English automatically on using terminal :)
    – sfate
    Commented Jun 23, 2018 at 8:31

1 Answer 1


Couldn't find a in-built preferences settings in iTerm. But you can use the KeyBoard Maestro to achieve it. If you don't have then download from the official site.

  1. Open KeyBoard Mestro.
  2. Create a group in Groups section (to hold all your specific automating processes).
  3. Now create a macro with the name Set iTerm Application Language.

    a. Add New Trigger -> The focussed window -> The focussed window changes

    b. Add another trigger -> This application -> Select iTerm -> Select Active -> Repeating every 1 seconds.

    c. Add New Action -> Select Set KeyBoard Layout -> Select the keyboard layout (i.e., language preference).

First Macro

  1. Now create another macro with the name Set Other Application Languages.

    a. Repeat a in previous macro.

    b. Add another trigger -> This application -> Select Any Application -> Select Activates.

    c. Repeat c from previous macro.

Second Macro

You are all set. While switching windows between iTerm and others, you can see the keyboard preference icon changing in the top menu bar on the right corner.

Note : The keyboard layouts will appear only if they are added in System Preferences -> Language & Region -> Input Sources. And the names of the macros can be anything. If you wish to deactivate the triggers, disable them by clicking the Tick mark on top-right side.

  • have the requirement resolved ? Commented Jun 26, 2018 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .