2

I work with Emacs within Docker as my dev environment so that I can have clean dev environments per language or type or projects that I do e.g. PHP dev, NodeJS dev, Haskell dev etc with different software or extensions installed etc.

Since upgrading to the latest version of Docker though (1.8, now 1.9) characters get misplaced, making a mess of the code. This happens when I open a file, or when I type something. This is only a display issue - the characters in the file are actually in the correct place. When I select the messed up lines (Ctrl+Space Ctrl+n or similar) the lines are corrected and properly displayed.

Usually characters get misplaced within the same line, but occasionally characters disappear or are overridden by other characters, or characters that do not belong to the line appear. One pattern that I have seen is that if I jump a page down with Ctrl+v, a line from the new visible part of the buffer gets messed up with the line that was previously there e.g. some of the characters of the 8th line from the bottom are overriden by the characters that where on the same line before jumping down. But there are other cases as well.

Attached are some screenshots that may clarify what happens.

This was not happening before the upgrade (I was using Docker 1.5 I believe, or earlier). The upgrade was part of a system upgrade to Fedora 23, but when I run emacs directly on the host I don't have this issue. The Docker container is based on the Fedora 23 official Docker image.

I'm not sure it is a Docker issue though. I would expect fedora to install all required dependencies when doing "dnf install emacs" since I believe the repositories are the standard Fedora repositories. But since the Fedora Docker image is a very minimal image, is there any package that I may need to install?

Any insights are welcome, my dev environments are kind of unusable at the moment.

Messed up code Messed up code

Corrected by selection Corrected by selection

Messed up code Messed up code

Corrected by selection Corrected by selection

Messed up code Messed up code

Corrected by selection Corrected by selection

Drew
  • 77,472
  • 10
  • 114
  • 243
krystalcode
  • 219
  • 1
  • 7
  • 3
    Does C-l (the letter "el") display things correctly? If not, and if you can reproduce the problem starting from emacs -Q (no init file), then consider filing a bug report: M-x report-emacs-bug. But if it does, then this sounds like a Docker problem, not an Emacs problem. – Drew Dec 22 '15 at 21:07
  • I recently had similar problem on Fedora and read about similar problem on RHEL 6.6, where running Docker would somehow influence the display. In my case I had to install a different version of Docker and the problem went away. But I'd try asking Docker people about the problem. It could be they do something with X-server, something like caching its connections or something... (not sure it's possible, just a guess) – wvxvw Dec 22 '15 at 22:45
  • Thanks for the responses, C-l corrects things, as with selecting a region. I have made a question on the Docker forums and I'll report back here if I get a response with a resolution. https://forums.docker.com/t/display-issues-with-emacs-buffers-within-docker-containers/5229 – krystalcode Dec 23 '15 at 00:37
  • Also, see if you have many errors logged in ~/.xsession-errors, (this file can be often huge, if you have the same error happen over and over while running X-server, just be warned). – wvxvw Dec 24 '15 at 08:12
  • I do not have an answer on this but got exactly the same behavior on my laptop, emacs-version: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian. However I notice the problem only on buffers that have unicode characters such as: (u1F44B) for instance. I wonder if this is not a display problem coming from the system rather than emacs. Does anybody know how I can debug this behavior? Thanks for the help! – Paul B. Dec 03 '17 at 18:15
  • 2
    @PaulB.: normally, you would put a bounty on a question if you need an answer to it. Since you don't have enough reputation yet to do so, I put a bounty up in the hopes of drawing attention to it. – Dan Dec 03 '17 at 19:56
  • Sounds like a problem with the terminal. One workaround would be to run emacs on the host, and edit files with TRAMP over ssh or something like that. –  Dec 04 '17 at 08:22
  • 1
    Could you describe how the Emacs running inside your Docker "VM" is displayed? Is it running inside a local text-terminal? Or is it using a "remote X11 connection"? Or is it using a VNC connection? – Stefan Dec 04 '17 at 14:09
  • I'm having similar issues on a slurm interactive job's pseudoterminal, and landed here. I suspect that there's an extra indirection in terminal emulation (e.g. host's terminal feature support is different than in the container), but emac's TERM environment variable is set to something the pty doesn't support. Not sure. If you were to ssh into the container instead (if it has it), vs just exec /bin/bash, do you also get corruption? – init_js Jun 13 '18 at 20:45

0 Answers0