ergoemacs/ergoemacs-mode

Ergoemacs .inputrc crashes Python

arun-mani-j opened this issue · 2 comments

Hii all.

Environment
OS : Debian Testing
I installed Ergoemacs in Spacemacs recently. Everything was working fine. There was a file named .inputrc in my home directory. It's contents :

# Based on Brendan Miller's initial bash .inputrc
# INSTALL
# to install, rename this file to just ".inputrc"
# place this file in your home dir. e.g. ~/.inputrc
# restart your terminal. Then, bash's keybinding for editing
# should be like ErgoEmacs.
# If no key works, try replace all \e to \M-. That's means change Esc to Meta key.

set editing-mode emacs
"\M-j": backward-char
"\M-l": forward-char
"\M-u": backward-word
"\C-M-b": backward-word
"\M-o": forward-word
"\C-M-f": forward-word
"\M-g": kill-line
"\<S-delete>": kill-line
"\M-e": backward-kill-word
"\M-r": kill-word
"\M-f": delete-char
"\C-z": undo
"\<S-delete>": kill-region
"\M-c": copy-region-as-kill
"\<S-insertchar>": yank
"\C-v": yank
"\C-f": forward-search-history
"\M-:": reverse-search-history

I think "Make Bash aware of ergoemacs keys" made the above file.

Problem
Whenever I run Python 3 (python3) or Python 2 (python) in any terminal (Emacs shell, GNOME Terminal, TTY), the prompt appears. And if I type something and press Enter, it gives Segmentation Fault. Example :

j_arun_mani@j-m-sj-s-a-c-k-g:~$ python3
Python 3.8.5 (default, Aug  2 2020, 15:09:07) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello") <Enter>

Segmentation fault
j_arun_mani@j-m-sj-s-a-c-k-g:~$ 

Observation
Removing the .inputrc file makes Python work properly. But running it again with .inputrc available, crashes Python.

Back Notes
I initially thought this was a bug in Python or one of it's modules. So I posted in Python Help mailing list. With help of Matthew Dixon, it took us 14 days to discover which caused the issue. I even reinstalled Python, Emacs, but nothing helped. Matthew suggested renaming .inputrc to see if anything improves. And it did. 😅

Thanks for Ergoemacs ! 😄

Hi; I'm not sure its an ergoemcas issue; Rather, it is a issue with .inputrc and python. .inputrc is not a part of emacs and is more of a convenience of using the same keys.

https://tiswww.case.edu/php/chet/readline/rltop.html

Shows it may be a readline + python issue.

However, you may debug the issue by commenting out the changes one by one to see which crashes python.

Thanks for the info, will try it out ^^