New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I tweak emacs Ctrl+h recognition? #1202
Comments
Ctrl+H is not a mintty shortcut but simply an ASCII control character. |
OK. I am still puzzled though. Partly I am puzzled because this causes interference with emacs, so I am puzzled about why nobody else seems to have brought it up. emacs is an Msys2 package and mintty is the Msys terminal so it's odd others haven't found it or reported it. In emacs https://www.gnu.org/software/emacs/manual/html_node/emacs/Name-Help.html I use it frequently to find out what What I also don't understand is the Msys2 mintty terminal is the only occasion when I face this problem of ctrl+h being undetected by emacs. It works in all other cases I have tried and those cases include the Windows GUI emacs, the cygwin console emacs, the cygwin GUI emacs, my WSL2 Linux installation and even the Msys2 GUI emacs. So, ctrl+h works as expected in emacs on every emacs instance I can test it with except the mintty console emacs. This is frustrating as it is mainly the Msys2 console emacs I want it to work with so I can develop in Msys2 using emacs in console mode. Also, I don't actually know how to make the changes you suggest as I am a mintty novice. |
Ctrl+h v works for me in emacs-nw. It prompts "Describe variable: ". |
Changed title as Ctrl+h is not a shortcut but rather a plain ASCII character. Also no mintty issue identified so far, I suspect it's an emacs configuration issue. |
OK, good. Well, my .emacs file is the same as it usually is for a basic install. In only includes the stable melpa repo for package extensions:
My .minttyrc file, which I have never looked at before, nor tampered with, looks like this:
Incidentally, using the same .emacs file if I open an emacs session with a GUI invoking it in mintty with |
Your .minttrc file was tampered with, by whoever. If it wasn't, it wouldn't even exist in the first place (in cygwin), not have setting Theme=dracula etc. |
Most "tampering" of |
Backspace mode can be changed via escape sequences: DECRST 67 to make it emacs-friendly, DECRQM and DECSET or XTSAVE and XTRESTORE to restore. |
OK, thanks. As per BrianInglis' note the .minttyrc file exists because I played with the options. I didn't tamper with .minttyrc directly, nor did I create it, whatever saves out the options did that for me. Also, thank you for the explanation but I still don't know how to fix it. On my system, if I remove the I have tried changing the .minttyrc filename to .minttyrcbkp and emacs still doesn't appear to capture c-h, even though mintty forgets its settings, as expected. c-x c-c still quits emacs in every case so I think it is come ctrl codes but not all. What do I do to get it to work? |
Did you start a new mintty window after the change? |
Yes. I have restarted mintty since and restarted the computer too. On my PC it doesn't matter what I set My .minttyrc file reads:
Oh. I have just noticed something. It works fine with cygwin and cygwin also uses mintty and it uses the same version too. I have just tried duplicating all my setting from the cygwin console to MING64 using the options menus and it doesn't help. |
You quoted your .minttyrc file to contain |
Well, yes, but clearly I have changed it since then, to the setting you recommended, hence my point: I have changed that setting to I have typed
My .emacs is as before:
I am even more puzzled since discovering it works perfectly well with cygwin but not with MSYS2/MING64. |
I've just replayed the case in MSYS2 and ^H v prompts "Describe variable" for me. |
I have asked on Stack Exchange too and the question has received no response. I am at a loss. |
Revisiting this issue, some more questions: |
Sorry about the delay. I had temporarily sidestepped the issue and decided to not use Msys instead. If I type
This is the same output I see if I type the same command for the Cygwin mintty where it works.
Not that I am aware of. I have only started it using the
The link to the Stack Exchange issue I started is here below. Nobody has responded to it in the two months since I posted it. It has only 24 views: |
I missed to ask a very basic question: Is it the native emacs package of your environment? What does |
|
For me it says |
There are two emacs packages in msys2.
List can be found here https://packages.msys2.org/search?q=emacs I am not familiar with emacs. But I can ask for help if needed. |
You know what? I think we're on to something. Biswa96 is right. There are two emacs packages and mintty is right our I had used the emacs installation process detailed here: https://packages.msys2.org/package/mingw-w64-x86_64-emacs It turns out there is another emacs package here: https://packages.msys2.org/base/emacs Since reading the messages above I have installed the older base package version. Now I also have I'd describe that as a big step forwards. Thanks! OK, I had paused after the line above to try an obvious step: Remove the mingw-w64-x86_64-emacs package. After uninstalling the other emacs package and restarting the console Either way, now when I run emacs, from anywhere, with Thanks! :D It only leaves me wondering why the w64 version does not work and if it can it be fixed with options? |
I also encountered this problem, when I mapped the key in vim, vim could not receive ctrl-h. The vim executable I use is a windows native application:
When I installed the msys/vim package and tested it, everything worked fine. Windows native vim also does not work properly in wsl. |
If you mean the Backspace key, it sends the DEL character by default, not BS, in cygwin, like in Linux. Can be reconfigured. |
I am trying to run an emacs -nw session in mintty for Msys2 in Windows 11.
One of the emacs keyboard shortcuts is "c-h v" for help on a variable description.
This doesn't work and I think it is because ctrl + h is a mintty key combination for backspace (or something).
I don't want this to happen. I have a backspace key.
How can I remove ctrl + h from the list of mintty key combination so I can use emacs?
The text was updated successfully, but these errors were encountered: