0

When I open files with emacs it adds 12;rgb:1c1c/1c1c/1c1c on the top. How can I prevent this?

I have installed emacs on a clean reinstalled debian system.

Emacs: GNU Emacs 24.4.1

Terminal Emulator: MobaXterm Personal Edition v7.7

System (local): Windows 7 Ultimate

System (remote): Debian 8.0 "jessie" stable

Evren
  • 163
  • 1
  • 9
  • 1
    Which terminal emulator are you using? – Ry- May 17 '15 at 02:02
  • And what operating system? You say that you "have installed emacs cleanly"; how did you do this? – Chris May 17 '15 at 02:11
  • Sry, I forgot that. @minitech: `I´m using MobaXterm Personal Edition v7.7` @Chris: I´m using `debian 8.0 "jessie" stable`, I also installed emacs on a new (clean reinstalled) system. – Evren May 17 '15 at 07:37
  • !! SOLVED IN MOBAXTERM VERSION 8.2 !! – Evren Sep 13 '15 at 13:23

4 Answers4

4

As noted, "MobaXterm" is not "xterm". According to its webpage it is

Based on PuTTY/MinTTY with antialiased fonts and macro support

Lacking a detailed change history, and the problem reported by the OP, it seems that MobaXterm is based on PuTTY from a while back, and does not implement all of the control sequences which PuTTY does, much less those of xterm.

The particular sequence which is not recognized (referring to XTerm Control Sequences) may be this:

OSC Ps ; Pt ST
OSC Ps ; Pt BEL
...
    Ps = 1 2  -> Change text cursor color to Pt.

That is part of a group of controls predating ANSI color support in xterm, referred to as dynamic colors.

Based on comments in other places, it seems that the problem could lie within the OP's Emacs configuration, by using scripts which do an ad hoc test of TERM to decide if it can do colors, rather than inspecting the terminal capabilities. See Terminal emacs colors only work with TERM=xterm-256color where someone worked around this problem by modifying their init.el to add special cases for rxvt and xterm.

Emacs of course is capable of doing colors in different terminals. See emacs colors based on $TERM environment variable for comments. And TERM=xterm on Debian has provided color for quite a while. So in a typical configuration, color should "just work".

However, there are different ways to configure Emacs. Attempting to reuse some 256-color script can fall into the hole dug by developers who assume that every terminal is just like the one in front of them. See the Emacs wiki page X Term Colors for an example.

Community
  • 1
  • 1
Thomas Dickey
  • 43,185
  • 7
  • 51
  • 88
  • First thank you for your support! Commands like `TERM=xterm emacs -nw` or `export TERM=xterm` + `emacs -nw` works fine for me and I can switch to another file without any problems. But when I type directly `emacs /etc/apache2/apache2.conf` for example emacs adds `12;rgb:1c1c/1c1c/1c1c` again on the top. By the way: coloured terminal works fine for me, it is only annoying that emacs adds this above. – Evren May 20 '15 at 12:25
  • In the other comments, it was implied that `TERM` would be `xterm` in the shell from which emacs was run. But prefixing the assignment in this way ensures it. So perhaps the shell did not really have `TERM` set to `xterm`. – Thomas Dickey May 20 '15 at 12:36
2

!! SOLVED IN MOBAXTERM VERSION 8.2 !!

Evren
  • 163
  • 1
  • 9
0

Looks like your terminal settings are out of sync. The settings of your terminal need to agree with the termcap/terminfo settings on the server. Try to set the TERM variable in the shell on the server to a value which better matches the terminal emulation capabilities of your terminal (common values are xterm, xterm-color, vt520, and vt102) or correspondingly change the settings of the terminal to match the current TERM value. (If the terminal is buggy, you may need some trial and error to find a mode which works well for you.)

tripleee
  • 139,311
  • 24
  • 207
  • 268
  • I have the following types to choose in MobaXterm: `xterm`, `xterm-r6`, `vt100`, `vt220`, `vt900`, `OpenVMS`, `Netterm100`, `Netterm220`, `ShiftFnKeys` and I am using `xterm` by default (works fine on my other server `debian 7.6`). With this types: `vt100`, `vt220`, `Netterm100`, `Netterm220` emacs adds nothing on the top, but now the console is not coloured, only black and white. I also typed `export TERM=xterm` and `export TERM=xterm-256color` but than I have the same problem,. By the way: this happens only with emacs, vi works fine on this machine. I hope you can help me. – Evren May 18 '15 at 11:36
  • I don't have access to MobaXterm so I can't play around with those settings. Try the different settings and see if you get one with an acceptable appearance / functionality compromise for you; or maybe try a different terminal (when I have to use Windows, I use [Putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/), which is popular, well-supported, and free; but I have not examined MobaXterm for possible advantages). – tripleee May 18 '15 at 11:48
  • http://invisible-island.net/xterm/xterm.faq.html#xterm_terminfo suggests maybe try `xterm-new` on the Debian side; probably then use `xterm` in [MobaXterm](http://mobaxterm.mobatek.net/). (Ooooh, I see it includes an X server. Nifty.) – tripleee May 18 '15 at 11:53
  • No, it doesn't changed anything. Should I report this to MobaXterm? – Evren May 18 '15 at 12:06
  • I'm thinking yes. It could be a bug in Emacs or in the Debian terminal driver, but they probably both have a larger and more diverse user base than MobaXterm, so it would seem like the most likely culprit. – tripleee May 18 '15 at 12:51
  • MobaXterm isn't "xterm". I recall it as using PuTTY or mintty with some changes. But it should work passably well with "xterm" and on Debian that should give colors. So some detail is missing. – Thomas Dickey May 18 '15 at 21:06
0

VT220 works fine; Edit Session / Terminal Settings / Type: vt220

Carl Krig
  • 151
  • 7