I'm using iterm2 v3.0.2 with fishs hell and tmux in osx. When I'm opening file via emacsclient and closing buffer - I'm successfully returning to terminal, BUT iterm2 window has no focus, so I have to click on window to gain it. I tested behaviour inside tmux session and outside - the same behaviour.

My command to run emacsclient:

emacsclient -c -a \"\" $argv
  • That sounds more like a problem with your window manager than with Emacs. Maybe you could try a different one? – phils Apr 15 '17 at 21:28

Maybe you can try to switch to your terminal app explicitly when C-x # (server-edit, the command to tell emacsclient that you finish editing):

(add-hook 'server-done-hook
          (defun open-terminal ()
            (shell-command "open -a Terminal")))

You also need to replace Terminal with iTerm since you are using iTerm2, not the built-in Terminal. I don't have iTerm2 installed on my Mac, so I can't try it myself.

| improve this answer | |
  • nope, didn't helped( – sandric Jun 18 '16 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.