reddit / emacs

[end] and [home] keys are not defined

waspentalive · 2022-12-13 10:03
\[end\] says "M-\[ f" is undefined, \[home\] displays "M-\[ h" is undefined. I created a \~/.emacs (there was none before that "(global-set-key (kbd "M-\[ f") 'move-end-of-line) Ok, that moves me to the end of the line, but it also highlights all the text I moved over. whereas M-x move-end-of-line just moves the cursor to the end of the line. I am a very emacs noob, so I apologize if I am asking my question improperly. I have looked at several websites to find what I could find but I just can't seem to make it work. I have since removed the \~/.emacs file ​ Here is a new bit of news - I just found out the problem is only under the GUI in a terminal (Qterminal in LXQT) The CLI (non-X) pseudo terminals don't have this issue. C-e and C-a actually work but on my other machines and in text-only mode (non-X) on this machine \[home\] and \[end\] serve to go to the beginning and end of the line I am on.
yurikhan · 2022-12-13 11:53
First, you are using Emacs in a terminal emulator. This is suboptimal. Some key combinations are not going to work without substantial effort. (This includes `Super`+anything, `Ctrl`+digits, `Ctrl`+punctuation, `Ctrl`+`Shift`+letters.) Second, your `TERM` environment variable and/or the terminfo database entry that it refers to does not match the actual capabilities of your terminal emulator. Post the output of `echo $TERM` and `infocmp` as executed from the afflicted terminal.
waspentalive · 2022-12-13 17:26
Ok, As it stand now - I was mainly going to use this machine without X running, and so I see Emacs is better suited for use on a psuedo terminal and not under X, at least not under LXQT. Thanks for your response. I rarely have to go into X as Linux on this machine is mainly to move files on/off the machine for FreeDOS. I have other machines for code development where Emacs does not mis-behave under the GUI. Please consider this one solved.