Emacs leaves terminal in "cursor addressing mode" after exit - emacs

When I close 'emacs -nw' with C-x C-c, the terminal often remains in "cursor addressing mode", which causes the scrolling not to work. According to askubuntu, this is due to emacs failing to exit cleanly. Is there a way to force emacs to exit cleanly every time?
I am using Gnome terminal on Ubuntu 16.04.

Related

How do I exit Emacs from the terminal?

I just installed Emacs 26.3 on Ubuntu 20.04. I opened a buffer in the terminal, and I cannot close it. C-x C-c does nothing. f10 to activate the menu does not activate the menu.
I'm using a .emacs file that maps cut/copy/paste commands to the normal C-x/C-c/C-v. I don't think that this can affect the issue, however, because I have the exact same setup (including the same .emacs file) on by Emacs 24.5/Ubuntu 16.04 laptop, and it has no problem exiting with C-x C-c. Also, I had the exact same problem before I installed the .emacs file on the new system.
How do I kill Emacs?
This question exists, but it has no useful answers.
ESC x save-buffers-kill-terminal
OFC binding C-x will affect C-x C-c. You don't need to know anything about Emacs to realize the problem. Just think twice.

Emacs Mode Line Click Change Buffer

In some installation of Emacs for the terminal, I had that if you click (text mouse cursor) on the buffer name in the mode line it jumped to the next buffer.
I search for a while but I couldn't find it.
Do someone remembers how to achieve this.
OS : OS X Terminal
Emacs: GNU Emacs 26.3
(Now I have Catalina, but I should have been in previous versions)
Try turning on mouse mode in your terminal emacs: M-x xterm-mouse-mode RET. This seems to work with emacs -nw in either an xterm or a gnome-terminal on linux. Whether it works on OS X and whatever terminal emulator it provides, I have no idea.
This Unix & Linux SE question contains much more information and some useful links.

On launch emacs makes "ding" sound and displays "<noname> is undefined" message

I was using a very old version of Emacs on Windows 7 Professional 64 bit so I upgraded to Emacs 25.3.1 64 bit. The installation went well.
When I ran Emacs, I started reading the messages in the initial buffer and then I heard a "ding" sound and the message "<noname> is undefined" was displayed.
I started typing into the buffer and approximately 10 seconds after the first "ding" sound there was another and the message "<noname> is undefined" message was displayed again.
If I try to enter text into the buffer or enter a command, I'm interrupted by the "ding" and "<noname> is undefined" message. This makes Emacs useless.
Thinking that perhaps there was something in my Emacs initialization file which is no longer valid, I closed Emacs and renamed the Emacs initialization file, then launched Emacs again. Same "ding" sound and same message.
I'm not sure what "noname" Emacs is complaining about or how to fix it. It is now almost 3 AM (US Eastern time) so I'm going to get some sleep and attack this in the daylight hours.
Oh! One other thing - I access the Windows 7 Professional 64 bit box via Remote Desktop, as the computer is in a facility in another state.
Any idea as to what is going on?
More Information:
I rebooted after installing the new version of Emacs. When the computer rebooted it automatically launched the DishAnywhere player.
Normally I kill the DishAnywhere player shortly after launch, but last night I didn't, so DishAnywhere was running when I launched Emacs.
Today I've run some experiments and found:
-- If DishAnywhere is running and I launch Emacs, Emacs will "Ding" and display the "<noname> is undefined" message every 10 seconds.
-- If I exit Emacs and kill off DishAnywhere, then launch Emacs, Emacs runs correctly - no "Ding" or error message.
-- If I launch DishAnywhere AFTER Emacs has started running, no "Ding" or error message.
-- If I then exit Emacs, wait a few minutes, and then launch Emacs again (while DishAnywhere is running), Emacs runs correctly - no "Ding" or error message.
So...
If DishAnywhere runs BEFORE Emacs is launched, Emacs has a problem, "Dings" and displays an error message.
If Emacs is launched BEFORE DishAnywhere and is running when DishAnywhere is launched, then Emacs runs correctly.
The workaround is to:
Kill DishAnywhere before launching Emacs, then launch DishAnywhere.
But the question is what is the interaction between DishAnywhere and Emacs that causes the issue?
Does this happen when you start Emacs using emacs -Q? If so then use M-x report-emacs-bug, providing a recipe of what you are doing and what you see.
If not (which is what I'm guessing) then recursively bisect your init file to find the culprit code. You can use command comment-region to comment out a block of code. If you use C-u with comment-region then it uncomments a block of code.
Comment out 1/2, then 3/4, then 7/8, ... of your init file, to narrow the problematic part. This is a binary search, so it is very quick to do, even if it means restarting Emacs multiple times.

How to terminate process inside EShell mode?

Background Information
I am using Spacemacs as my default configuration. I am running a JavaScript infinite loop inside my EShell using Node.js. In the regular terminal, I usually terminate it by using C-c. What should I do inside EShell?
I have read the section about shell mode and terminal emulator in the Emacs doc, but find no help and related command to terminate the process.
Question
How can I terminatr the process inside EShell-mode without restarting the editor? Although restarting the editor does solve the issue.
Even killing the buffer does not work. Oh dear, it is still running.
Solution
C-c C-c, eshell-interrupt-process.
Huge thanks to #tripleee.

emacs in console mode does not work

When I launch emacs in console mode or in terminal with -nw option, emacs launches in terminal but none of keys work. I cannot type anything or even cannot exit by C-x C-c. Though I can see a blinking cursor. Same emacs works fine in GUI mode. Any clues will be helpful. I'm running debian 2.6.
I finally resolved the issue by installing emacs23-nox. Probably it installed any missing dependency. Now launching emacs in terminal mode works. Interestingly, when I had uninstalled and installed emacs again, that did not resolve the problem. Anyway, I'm all set.