this post was submitted on
5 points (85% like it)
6 up votes 1 down vote
all 14 comments

[–]tashbarg 2 points3 points ago

Stuff prepended to files at saving sounds like unicode byte order mark, but what you wrote (B1;2c) isn't one. Very strange.

Since the behavior is dependent on GUI or not GUI, I would check the environment variables of both. Perhaps the shell variant has a different LANG, LC* or something.

It's just a wild guess, but perhaps it helps. Compare the content of process-environment when started from GUI to that when started from shell. (C-h v process-environment).

[–]onyxrev[S] 0 points1 point ago

Good idea. It happens both on my BSD and Linux machines.

[–]onyxrev[S] 0 points1 point ago

The terminal/shell varient has a LANG defined (LANG=en_CA.UTF-8) while Carbon Emacs doesn't. That's one of the only differences besides the garbage RVM throws in there for my Ruby work (ugh).

[–]michaelhoffman 2 points3 points ago*

It took me a moment to realize that by "shell mode" you mean running Emacs within a terminal, rather than the Emacs shell-mode.

This happens on both your Linux and BSD machines? Are you using them from the console or logging in remotely?

[–]onyxrev[S] 0 points1 point ago

ahhh - sorry about that. This is via SSH from bash.

[–]michaelhoffman 0 points1 point ago

What is the client computer and what terminal software are you using there? That probably has a lot more to do with this than Emacs.

[–]onyxrev[S] 0 points1 point ago

OSX Lion's stock Terminal 2.2.2

[–]tashbarg 0 points1 point ago

wadcann's comment seems to be spot on. Try to set another terminal emulation mode for Terminal or try another emulator (iTerm, xterm through X11).

[–]onyxrev[S] 0 points1 point ago

Good idea. I have no particular love for OSX's stock Terminal.

[–]greenrd 1 point2 points ago

What do you mean by "exit a file"?

[–]onyxrev[S] 0 points1 point ago

More specifically it seems to happen most when I C-x C out of emacs.

[–]onyxrev[S] 0 points1 point ago

Actually it can't be my .emacs because my most recent experience with it was on a new deployment of FreeBSD where I hadn't uploaded my emacs goodies yet.

[–]wadcann 1 point2 points ago

Well, the last part looks a bit similar to the tail end of an escape code for a terminal key sequence.

Xterm seems to send "<ESC>[1;2C" when I hit shift-right-arrow.

I'm not sure where the "B" comes from, though.

[–]onyxrev[S] 0 points1 point ago

I noticed that too. I will try a different terminal program and see if it still happens.