In Emacs, I have bound Ctrl-= to a custom function.
What is strange is that when I run Emacs in a terminal, hitting Ctrl-= just enters an equal sign and does not execute this custom function. In a GUI window, everything works as intended.
I have tried different terminal programs, but this does not seem to make a difference.
What could be the reason that Ctrl-= is not received by Emacs as such?
On my keyboard, Ctrl-= actually is Ctrl-Shift-0, just if that matters.
My system is Kubuntu 22.04.
UPDATE:
Since this was asked, the definitions that do not work in a terminal (here in Konsole, emacs started with -nw option) are:
(global-set-key (kbd "C-M-<") 'indent-region)
(global-set-key (kbd "C-=") 'xxxx)
It seems that this is a limitation of running Emacs in a terminal.
Here (https://www.gnu.org/software/emacs/manual/html_node/elisp/Other-Char-Bits.html) it says:
2.4.3.5 Other Character Modifier Bits
(...) ASCII has no way to represent whether a control character is upper case or lower case. Emacs uses the 2**25 bit to indicate that the shift key was used in typing a control character. This distinction is possible only on a graphical display such as a GUI display on X; text terminals do not report the distinction.
As far as I see this extends to other modifier keys, e.g. Alt, "super" and "hyper", which I set to the "Windows" key.
.emacs
file where you have defined this. Also, clarify what you mean by "in a terminal". Is that a GUI terminal emulator runningemacs -nw
? Have you dropped to a tty? Are you logging into a system without GUI?