5

How can I reset the default behavior of no prepending (but still being able to use -nw) and not having the bottom half of my terminal be black space.

Having emacs test.py -nw -Q doesn't solve the issue, emacs test.py -Q doesn't result in the characters but it does produce a window that I'd rather not have.

I'm using emacs within a python jupyter shell, my version is GNU emacs 23.1.1, echo $TERM returns xterm.

As additional clarification, if I fully expand my terminal window, the emacs editor will only fill about half of the space. It isn't being filled with the "help editor" as sometimes happens.

Example behavior

5
  • 1
    Which terminal emulator you use (e.g. gnome-terminal), which emacs version and the value of your TERM variable inside the terminal will be relevant.
    – YoungFrog
    Commented Apr 19, 2016 at 17:13
  • I'm using emacs within a python jupyter shell, my version is GNU emacs 23.1.1. How do I check my TERM variable? Thank you. Commented Apr 19, 2016 at 17:16
  • When I open my file with emacs in my XQuartz shell I don't have these issues but I have in the past not had problems using Jupyter. Commented Apr 19, 2016 at 17:22
  • You can check the value of TERM with e.g. echo $TERM under your terminal. Also, I don't know what "python jupyter shell" is, but it doesn't look like the name of a terminal emulator, more like the name of a shell.
    – YoungFrog
    Commented Apr 19, 2016 at 20:10
  • Python jupyter (or ipython) is a command shell and the terminal emulator appears to be xterm. echo $TERM returns xterm. Commented Apr 19, 2016 at 20:13

1 Answer 1

4

The file etc/PROBLEMS (part of emacs) has some information on this problem.

** Unexpected characters inserted into the buffer when you start Emacs. See e.g. http://debbugs.gnu.org/11129>

This can happen when you start Emacs in -nw mode in an Xterm. For example, in the scratch buffer, you might see something like:

0;276;0c

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

This occurs when Emacs tries to query the terminal to see what capabilities it supports, and gets confused by the answer. To avoid it, set xterm-extra-capabilities to a value other than 'check' (the default). See that variable's documentation (in term/xterm.el) for more details.

Even if you connection is not slow, it can also happen that the value of your TERM variable doesn't match the actual capabilities of your terminal emulator — the result is still that emacs is confused.

7
  • Great thanks, since I am new to this can you tell me how to set a different value for xterm-extra-capabilities? Commented Apr 19, 2016 at 20:18
  • 1
    I think you can set it from your init file, i.e. add (setq xterm-extra-capabilities nil) there and see if it helps (of course, don't use -Q to test).
    – YoungFrog
    Commented Apr 19, 2016 at 20:21
  • I added that to my .emacs file and the unexpected characters still occured. Here are my current file contents if I've missed something (I can't seem to be able to preserve line formatting) : (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t)) (setq xterm-extra-capabilities nil) Commented Apr 19, 2016 at 20:29
  • Not sure why that happens... I hope someone else will be able to help.
    – YoungFrog
    Commented Apr 19, 2016 at 20:40
  • Thanks, this is pretty annoying, more so because this wasn't always an issue and I'm not sure what has changed. Commented Apr 19, 2016 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.