You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Graphical emacs doesn't work; spins on poll()/writev()/recvmsg() #611
Install emacs in WSL: sudo apt-get install emacs24
Set export DISPLAY=localhost:0 in a WSL terminal
Run emacs in the same WSL terminal
Expected:
A graphical emacs window should appear, rendered by Xming
Actual:
This appears:
And emacs hangs / is unresponsive. The X button in the top-right corner does not close it. Ctrl-C in the WSL terminal window doesn't close it either. It's necessary to get a shell prompt and do a kill -9 to get it to close.
Reacted by Benjamin Bourgeais, Tobia Tesan and Hakan Alpay
Interestingly, if I open up a WSL terminal and do ssh -X real-ubuntu-1404-server, then run emacs remotely, it shows up correctly in Windows/Xming, and the application is responsive.
In this scenario, emacs is emitting syscalls considerably more slowly than it was when running locally. The server in question is slower. But I wonder whether perhaps some syscall is not causing its thread to de-schedule for as long as it would under Linux, resulting in some sort of starvation?
Zhao.MA (@xarthurx) mentioned a somewhat similar problem in a comment on #187 , but with different symptoms. I wonder if this could be a race condition of some sort.
It's probably worth pointing out that command-line emacs works just fine. You can verify this by either un-setting the DISPLAY environment variable and running emacs, or running emacs -nw.
I can confirm that graphical emacs works for me with the "emacs-snapshot" package in the "ppa:ubuntu-elisp" PPA, which currently reports as "GNU Emacs 25.1.50.2".
Adam Seering (@aseering)Hasan Abbasi (@redviper) Do you guys have any problem with maximize emacs window? This is my problem emacs-snapshot with Xming. It doesn't refresh current frame fit to maximized window width & height.
I tried to run emacs with MobaXTerm. No luck on maximize window, but I think MobaXTerm is better than Xming on display images and more clear fonts.
Some of commands that related to widgets such like GTK does not work, so I guess emacs with some other GUI library would possibly work if it supported.
(menu-bar-mode 0) ;; no effect
(tool-bar-mode 0) ;; no effect too
Adam Seering (@aseering) Would you try this? It seems like emacs's --geomerty option works. Menubar and toolbar does not appear but the frame extended properly.
lateau -- yes, -g lets me start with a larger window size.
I don't see a continuous loop of strace output. I see a lot of output whenever I interact with the window in any way -- mouse is over the window, cursor is blinking, etc -- but that's what I would expect given that emacs is interacting with the screen (and over TCP, even) whenever those things happen.
Adam Seering (@aseering) You're right. Launch emacs with -nbc -Q does not produce that continuous output. Thank you. Loop was my misunderstanding it's just cursor blinking event output.
You can fix the resizing issue by compiling a Lucid version instead of GTK. The problem seems to be something with the GTK resizing code. Get emacs from the git repo (I recommend the GitHub mirror btw, Savannah is slow), and build with ./configure --with-x-toolkit=lucid
You can get all the dependencies worked out before hand too with apt-get build-dep emacs24-lucid.
Reacted by Younes Ait Loutou, Carmine Casciato and Omar Hughes
This circa 2016 issue is I think (?) fundamentally dupe #1609 (epoll wait doesn't). Even if the problem wasn't that issue specifically, there is a lot of select/poll water under the bridge since this issue was submitted. We'll call it fixedcreatorsupdate. If there are any outstanding issues with xemacs running on WSL that would not manifest in the same way when running remotely from Real Linux to Xming, VcXsrv, Windows Remote Desktop via xrdp (etc etc) do feel to break out a follow-up.
Activity
aseering commentedon Jul 1, 2016
strace emacslooks like a constant stream of:being dumped out about as quickly as I would expect the Windows Console to be able to render it.
aseering commentedon Jul 1, 2016
Interestingly, if I open up a WSL terminal and do
ssh -X real-ubuntu-1404-server, then runemacsremotely, it shows up correctly in Windows/Xming, and the application is responsive.In this setup,
strace sshlooks a lot like:And
strace emacslooks like this:In this scenario,
emacsis emitting syscalls considerably more slowly than it was when running locally. The server in question is slower. But I wonder whether perhaps some syscall is not causing its thread to de-schedule for as long as it would under Linux, resulting in some sort of starvation?aseering commentedon Jul 1, 2016
Zhao.MA (@xarthurx) mentioned a somewhat similar problem in a comment on #187 , but with different symptoms. I wonder if this could be a race condition of some sort.
aseering commentedon Jul 1, 2016
It's probably worth pointing out that command-line emacs works just fine. You can verify this by either un-setting the
DISPLAYenvironment variable and runningemacs, or runningemacs -nw.redviper commentedon Jul 1, 2016
This has, oddly, been fixed in emacs-25 pretest. I am using graphical emacs atm.
aseering commentedon Jul 2, 2016
Thanks!
I can confirm that graphical emacs works for me with the "emacs-snapshot" package in the "ppa:ubuntu-elisp" PPA, which currently reports as "GNU Emacs 25.1.50.2".
lateau commentedon Jul 2, 2016
Adam Seering (@aseering) Hasan Abbasi (@redviper) Do you guys have any problem with maximize emacs window? This is my problem emacs-snapshot with Xming. It doesn't refresh current frame fit to maximized window width & height.
These doesn't work for me. Any ideas?
aseering commentedon Jul 2, 2016
Oh, good point -- yes, I do have that problem now, with the new emacs version.
lateau commentedon Jul 2, 2016
I tried to run emacs with MobaXTerm. No luck on maximize window, but I think MobaXTerm is better than Xming on display images and more clear fonts.
Some of commands that related to widgets such like GTK does not work, so I guess emacs with some other GUI library would possibly work if it supported.
lateau commentedon Jul 2, 2016
Frame paramters are not modifiable.
lateau commentedon Jul 2, 2016
Adam Seering (@aseering) Would you try this? It seems like emacs's
--geomertyoption works. Menubar and toolbar does not appear but the frame extended properly.Here's a strace log(constantly loop):
aseering commentedon Jul 2, 2016
lateau -- yes,
-glets me start with a larger window size.I don't see a continuous loop of strace output. I see a lot of output whenever I interact with the window in any way -- mouse is over the window, cursor is blinking, etc -- but that's what I would expect given that emacs is interacting with the screen (and over TCP, even) whenever those things happen.
lateau commentedon Jul 2, 2016
Adam Seering (@aseering) You're right. Launch emacs with
-nbc -Qdoes not produce that continuous output. Thank you. Loop was my misunderstanding it's just cursor blinking event output.redviper commentedon Jul 4, 2016
You can fix the resizing issue by compiling a Lucid version instead of GTK. The problem seems to be something with the GTK resizing code. Get emacs from the git repo (I recommend the GitHub mirror btw, Savannah is slow), and build with ./configure --with-x-toolkit=lucid
You can get all the dependencies worked out before hand too with apt-get build-dep emacs24-lucid.
masari commentedon Jul 6, 2016
xemacs works fine (although I never use it on real Linux)
redviper commentedon Jul 10, 2016
Recently I find that the yank for x-selection is broken. Is this happening for others also or have I messed up my WSL configuration?
lateau commentedon Jul 19, 2016
Hasan Abbasi (@redviper) It works on my build but sometimes it causes freezing emacs.
foopang commentedon Jul 21, 2016
I have problem with pasting text into emacs from Windows, while copying text from emacs to windows is just fine. Any workaround?
fehrin commentedon Aug 30, 2016
Where do i find the emacs-25 pretest package mentioned in this issue?
lateau commentedon Aug 31, 2016
fehrin
sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo apt-get update
VMatrix1900 commentedon Apr 22, 2017
Seems it's fixed in Creator's update, follow the instructions on the link: https://www.reddit.com/r/bashonubuntuonwindows/comments/65dpjd/getting_xapplications_running_in_ubuntu_16041/
therealkenc commentedon Mar 13, 2018
This circa 2016 issue is I think (?) fundamentally dupe #1609 (epoll wait doesn't). Even if the problem wasn't that issue specifically, there is a lot of select/poll water under the bridge since this issue was submitted. We'll call it fixedcreatorsupdate. If there are any outstanding issues with xemacs running on WSL that would not manifest in the same way when running remotely from Real Linux to Xming, VcXsrv, Windows Remote Desktop via xrdp (etc etc) do feel to break out a follow-up.