1

When emacs frozen, I restart it and I see that 84;0;0c may end up writting into very first line of the latest open file.


The way I start emacs daemon: emacsclient -c -qut file.txt 2>/dev/null. While this process is on-going when I type enter or some characters they show up on the opened file.

$ cat file.txt
MY_FILE_STARTS
$ kill -9 $(ps auxww | grep -E "[e]macsclient"  | awk '{print $2}')
$ emacsclient -qut file.txt 2>/dev/null
alper
alper
alper

Than opened file shown as follows:

lper
alper
alper

84;0;0cMY_FILE_STARTS

Simple solution would be not to enter any keys while emacs daemon is starting but accidently I may end up typing enter once in a while.

What does 84;0;0c stands for and is it possible to prevent writing those characters when emacs is unresponsive?

alper
  • 1,370
  • 1
  • 13
  • 35
  • 1
    Have you tried to interrupt Emacs from some shell command line via pkill -SIGUSR2 emacs? That should start the debugger. It may be necessary to call pkill -SIGUSR2 emacs multiple times. – Tobias May 20 '22 at 12:34
  • Yes but when emacs freeze and when I try to exit from the daemon or press some keys they written into buffer and shows up after the emacs starts working – alper May 25 '22 at 18:32
  • @Tobias I figure out the reason for this. I was starting emacs daemon as follows: emacsclient -qut 2>/dev/null after this when I press any key like enter that writting into 1st line of the open file followed by 84;0;0c – alper Jun 08 '22 at 13:09
  • This is probably not an Emacs problem. What terminal emulator are you using? Do you get the same results if you use xterm instead? – db48x Jun 09 '22 at 00:48
  • I am using iTerm2(https://iterm2.com) ; same problem occurs in Terminal – alper Jun 09 '22 at 16:28
  • I don't have this problem on macOS, iTerm2 and Emacs 28.1 – Tianshu Wang Jun 10 '22 at 13:02
  • I suggest you divide and test your Emacs and ZSH related config. – Tianshu Wang Jun 10 '22 at 13:06
  • @TianshuWang This is not related to zsh ; it happens with bash as well. – alper Jun 10 '22 at 13:27
  • What do the emacsclient options -qut do? I don't find them in my emacsclient man page at all. As for "starting the emacs daemon", I don't understand what you mean: emacsclient cannot start the daemon - instead you start emacs with --daemon and it runs in the background without a frame, but starts a server to listen. Then you invoke emacsclient to connect to the server. In short, I don't think you are describing the situation you are facing accurately enough, so nobody can figure out what's really happening, let alone fix it. – NickD Jun 10 '22 at 20:58
  • FWIW, I guess somebody is issuing an ANSI escape sequence (e.g. 'ESC [ 84;0;0c) but I cannot find one that ends inc`. – NickD Jun 10 '22 at 21:01
  • issuing at emacs repo? Should I ask this question in https://unix.stackexchange.com since seems like this issue could be resolved by correct usage of linux commands – alper Jun 11 '22 at 13:23
  • @NickD my problem was related to following question: https://emacs.stackexchange.com/questions/16878/0950c-escape-code-is-inserted-with-typeahead-in-terminal-emacs/41004#41004 . Seems like I just had to do: (setq xterm-extra-capabilities nil) – alper Jun 21 '22 at 19:22
  • Write it up as an answer and accept it (after the waiting period). – NickD Jun 22 '22 at 01:54
  • @NickD done hope my answer will be helpful – alper Jun 22 '22 at 09:42

1 Answers1

2

I found the solution in 0;95;0c escape code is inserted with typeahead in terminal emacs and Everytime I open emacs with -nw my file is prepended with 0;276;0c. My screen realestate is also being cut in half.

My problem was:

This is more likely to happen if you are using Emacs over a slow connection, and begin typing before Emacs is ready to respond.

Solution:

Customizing xterm-extra-capabilities and setting the capabilities manually makes the problem go away. But if I set it to nil the bug goes away.

I had to add: (setq xterm-extra-capabilities nil) into my init file to fix this problem.

alper
  • 1,370
  • 1
  • 13
  • 35