0

Currently using Emacs on Windows Subsystem for Linux (WSL).
I have this alias for emacsclient executable:

alias e='emacsclient -n'

Which I run very often when I am on the terminal (I use ConEmu or terminator).

The problem is that whenever I execute it, Emacs windows is not brought to front.
So I have to search for it with Alt+TAB...
Which I find a bit annoying when I have a bunch of windows opened.

Is there a way to bring Emacs to front when running emacsclient ?

0

This is a kind of quirky way of achieving it, but it worked for me.
Having frame-title-format set to its original value:

(setq frame-title-format '(multiple-frames "%b"
                                           ("" invocation-name "@" system-name)))

shows this on wmctrl utility to interact with X-Windows manager:

$ wmctrl -l
0x00e00003  0 ES-00002604 /bin/bash
0x0120001d  0 ES-00002604 emacs@ES-00002604

So, writing this short bash script e.sh:

#!/bin/bash
emacsclient -n $1
wmctrl -a nephewtom

And having this alias defined:

alias e='e.sh'

Allows me to work like this:

enter image description here

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.